Skip to content

Update to Babel 8#21475

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
nicolo-ribaudo:babel-8
Jul 3, 2026
Merged

Update to Babel 8#21475
timvandermeij merged 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.82%. Comparing base (25eae30) to head (b9609d0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21475      +/-   ##
==========================================
+ Coverage   89.80%   89.82%   +0.01%     
==========================================
  Files         261      261              
  Lines       66346    66346              
==========================================
+ Hits        59581    59592      +11     
+ Misses       6765     6754      -11     
Flag Coverage Δ
browsertest 66.62% <ø> (+<0.01%) ⬆️
fonttest 9.03% <ø> (ø)
integrationtest 68.95% <ø> (-0.10%) ⬇️
unittest 57.28% <ø> (+<0.01%) ⬆️
unittestcli 56.23% <ø> (-0.02%) ⬇️

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.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

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

Does that testing include the gulp generic-legacy and gulp lib-legacy builds, given the core-js changes in this patch?

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with the question above addressed. Thank you for helping out with this!

@nicolo-ribaudo

Copy link
Copy Markdown
Collaborator Author

Just checked the two legacy builds, and the changes are the same as what described in the PR description.

Note that the core-js changes are not in what is actually polyfilled, but just that now we call babel-plugin-polyfill-corejs3 directly (in Babel 7, @babel/preset-env would call babel-plugin-polyfill-corejs3 internally).

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, with passing browser tests. Thank you!

@timvandermeij

Copy link
Copy Markdown
Collaborator

/botio browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/cadf627c878fa9f/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/cdd40e91b61e190/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/cdd40e91b61e190/output.txt

Total script time: 18.11 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/cadf627c878fa9f/output.txt

Total script time: 26.26 mins

  • Regression tests: FAILED
  errors: 6

Image differences available at: http://54.193.163.58:8877/cadf627c878fa9f/reftest-analyzer.html#web=eq.log

@nicolo-ribaudo

Copy link
Copy Markdown
Collaborator Author

/botio browsertest-windows

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @nicolo-ribaudo received. Current queue size: 0

Live output at: http://54.193.163.58:8877/67bbc5d509c42a2/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @nicolo-ribaudo received. Current queue size: 0

Live output at: http://54.241.84.105:8877/4bd101b6afd453e/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/4bd101b6afd453e/output.txt

Total script time: 18.43 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/67bbc5d509c42a2/output.txt

Total script time: 25.97 mins

  • Regression tests: Passed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants