Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only bundle NullL10n in GENERIC builds (bug 1859818) #17135

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/unit/unit_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion web/annotation_editor_layer_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/annotation_layer_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
2 changes: 1 addition & 1 deletion web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion web/pdf_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
18 changes: 18 additions & 0 deletions web/stubs.js
Original file line number Diff line number Diff line change
@@ -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 };
1 change: 1 addition & 0 deletions web/viewer-geckoview.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"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",
Expand Down
1 change: 1 addition & 0 deletions web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"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",
Expand Down