Skip to content

Update to Babel 8#21475

Open
nicolo-ribaudo wants to merge 1 commit into
mozilla:masterfrom
nicolo-ribaudo:babel-8
Open

Update to Babel 8#21475
nicolo-ribaudo wants to merge 1 commit into
mozilla:masterfrom
nicolo-ribaudo:babel-8

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

I diffed the Babel 7 and Babel 8 builds for generic, mozcentral, and lib. They are almost identical.

  • There re no differences in mozcentral
  • Both in generic and lib, when we inline the .ftl strings in

    pdf.js/web/genericl10n.js

    Lines 135 to 141 in 7e7ed1b

    const text =
    typeof PDFJSDev === "undefined"
    ? await fetchData(
    new URL("../l10n/en-US/viewer.ftl", window.location.href),
    /* type = */ "text"
    )
    : PDFJSDev.eval("DEFAULT_FTL");
    , Babel 8 emits non-ASCII characters by default rather than forcefully escaping them (e.g. Babel 8 preserves , while Babel 7 converts it to \u2019).

I had to inline the Babel plugin that injects the header comment in the lib build, as it didn't support Babel 7. I opened a PR (Shopify/babel-plugin-add-header-comment#9), but it's so simple that it's probably not worth waiting.

The inlined plugin also keeps the copyright notice, which I believe should be there while it wasn't there before:

  -/**
  -* 
  -* 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.
  -**/
  +/* Copyright 2024 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.
  + */

@nicolo-ribaudo nicolo-ribaudo marked this pull request as draft June 19, 2026 11:19
@codecov-commenter

codecov-commenter commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.81%. Comparing base (59df671) to head (7a2f349).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21475   +/-   ##
=======================================
  Coverage   89.80%   89.81%           
=======================================
  Files         260      260           
  Lines       66075    66075           
=======================================
+ Hits        59339    59342    +3     
+ Misses       6736     6733    -3     
Flag Coverage Δ
browsertest 66.89% <ø> (-0.01%) ⬇️
fonttest 9.02% <ø> (ø)
integrationtest 68.91% <ø> (+0.01%) ⬆️
unittest 57.26% <ø> (+0.01%) ⬆️
unittestcli 56.22% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants