Only bundle NullL10n in GENERIC builds (bug 1859818)

This commit is contained in:
Jonas Jenwald 2023-10-18 20:13:10 +02:00
parent f39bedd06c
commit 69ad0d9861
10 changed files with 32 additions and 6 deletions

View File

@ -254,6 +254,7 @@ function createWebpackConfig(
"web-alt_text_manager": "web/alt_text_manager.js",
"web-annotation_editor_params": "web/annotation_editor_params.js",
"web-com": "",
"web-l10n_utils": "web/stubs.js",
"web-pdf_attachment_viewer": "web/pdf_attachment_viewer.js",
"web-pdf_cursor_tools": "web/pdf_cursor_tools.js",
"web-pdf_document_properties": "web/pdf_document_properties.js",
@ -284,10 +285,12 @@ function createWebpackConfig(
libraryAlias["display-node_utils"] = "src/display/node_utils.js";
viewerAlias["web-com"] = "web/genericcom.js";
viewerAlias["web-l10n_utils"] = "web/l10n_utils.js";
viewerAlias["web-print_service"] = "web/pdf_print_service.js";
} else if (bundleDefines.MOZCENTRAL) {
if (bundleDefines.GECKOVIEW) {
const gvAlias = {
"web-l10n_utils": "web/stubs.js",
"web-toolbar": "web/toolbar-geckoview.js",
};
for (const key in viewerAlias) {
@ -1556,6 +1559,7 @@ function buildLibHelper(bundleDefines, inputStream, outputDir) {
"display-node_utils": "./node_utils.js",
"fluent-bundle": "../../../node_modules/@fluent/bundle/esm/index.js",
"fluent-dom": "../../../node_modules/@fluent/dom/esm/index.js",
"web-l10n_utils": "../web/l10n_utils.js",
},
};
const licenseHeaderLibre = fs

View File

@ -29,6 +29,7 @@
"web-alt_text_manager": "../../web/alt_text_manager.js",
"web-annotation_editor_params": "../../web/annotation_editor_params.js",
"web-com": "../../web/genericcom.js",
"web-l10n_utils": "../../web/l10n_utils.js",
"web-pdf_attachment_viewer": "../../web/pdf_attachment_viewer.js",
"web-pdf_cursor_tools": "../../web/pdf_cursor_tools.js",
"web-pdf_document_properties": "../../web/pdf_document_properties.js",

View File

@ -9,14 +9,15 @@
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"paths": {
"pdfjs-lib": ["./src/pdf"],
"display-fetch_stream": ["./src/display/fetch_stream"],
"display-l10n_utils": ["./web/l10n_utils"],
"display-network": ["./src/display/network"],
"display-node_stream": ["./src/display/node_stream"],
"display-node_utils": ["./src/display/node_utils"],
"pdfjs-lib": ["./src/pdf"],
"fluent-bundle": ["./node_modules/@fluent/bundle/esm/index.js"],
"fluent-dom": ["./node_modules/@fluent/dom/esm/index.js"]
"fluent-dom": ["./node_modules/@fluent/dom/esm/index.js"],
"web-l10n_utils": ["./web/l10n_utils"]
}
},
"files": [

View File

@ -25,7 +25,7 @@
/** @typedef {import("../src/display/annotation_layer.js").AnnotationLayer} AnnotationLayer */
import { AnnotationEditorLayer } from "pdfjs-lib";
import { NullL10n } from "./l10n_utils.js";
import { NullL10n } from "web-l10n_utils";
/**
* @typedef {Object} AnnotationEditorLayerBuilderOptions

View File

@ -25,7 +25,7 @@
/** @typedef {import("./text_accessibility.js").TextAccessibilityManager} TextAccessibilityManager */
import { AnnotationLayer } from "pdfjs-lib";
import { NullL10n } from "./l10n_utils.js";
import { NullL10n } from "web-l10n_utils";
import { PresentationModeState } from "./ui_utils.js";
/**

View File

@ -42,7 +42,7 @@ import {
import { AnnotationEditorLayerBuilder } from "./annotation_editor_layer_builder.js";
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
import { compatibilityParams } from "./app_options.js";
import { NullL10n } from "./l10n_utils.js";
import { NullL10n } from "web-l10n_utils";
import { SimpleLinkService } from "./pdf_link_service.js";
import { StructTreeLayerBuilder } from "./struct_tree_layer_builder.js";
import { TextAccessibilityManager } from "./text_accessibility.js";

View File

@ -63,7 +63,7 @@ import {
VERTICAL_PADDING,
watchScroll,
} from "./ui_utils.js";
import { NullL10n } from "./l10n_utils.js";
import { NullL10n } from "web-l10n_utils";
import { PDFPageView } from "./pdf_page_view.js";
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
import { SimpleLinkService } from "./pdf_link_service.js";

18
web/stubs.js Normal file
View File

@ -0,0 +1,18 @@
/* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const NullL10n = null;
export { NullL10n };

View File

@ -62,6 +62,7 @@ See https://github.com/adobe-type-tools/cmap-resources
"web-alt_text_manager": "./stubs-geckoview.js",
"web-annotation_editor_params": "./stubs-geckoview.js",
"web-com": "./genericcom.js",
"web-l10n_utils": "./l10n_utils.js",
"web-pdf_attachment_viewer": "./stubs-geckoview.js",
"web-pdf_cursor_tools": "./stubs-geckoview.js",
"web-pdf_document_properties": "./stubs-geckoview.js",

View File

@ -71,6 +71,7 @@ See https://github.com/adobe-type-tools/cmap-resources
"web-alt_text_manager": "./alt_text_manager.js",
"web-annotation_editor_params": "./annotation_editor_params.js",
"web-com": "./genericcom.js",
"web-l10n_utils": "./l10n_utils.js",
"web-pdf_attachment_viewer": "./pdf_attachment_viewer.js",
"web-pdf_cursor_tools": "./pdf_cursor_tools.js",
"web-pdf_document_properties": "./pdf_document_properties.js",