Skip to content

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Mar 5, 2025

  • Rather than use esmodules as the anchor for "legacy" JS, use Baseline
  • Automate the creation of the polyfill modules to check for via core-js-compat. This made it feasible to add many more polyfills
  • Add additional tests to validate that each polyfill being checked can be consistently detected. If it cannot (even w/o source maps), it is excluded
  • Removes support for detecting core-js@2 polyfills. But the recently added warning if core-js@2 is detected remains.

This audit can now be described as: inform developers when they are polyfilling a feature that is widely supported across all major browsers, and provide an estimate for how much that costs (in terms of bytes / impact on metrics via byte efficiency).

@connorjclark connorjclark requested a review from a team as a code owner March 5, 2025 01:46
@connorjclark connorjclark requested review from adamraine and removed request for a team March 5, 2025 01:46
@connorjclark connorjclark requested a review from paulirish March 5, 2025 01:47
for (const coreJsVersion of ['2.6.12', '3.40.0']) {
await waitForVariants();

for (const coreJsVersion of ['3.40.0']) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You're leaving this as a for loop in case we need to support more corejs versions in the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, v4 is in the works.

// Map, Set, WeakSet, etc.
// collection("Map",
// Currently not used. See create-polyfill-module-data.js
// expression += `|collection\\(${qt(property)},`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I looked through create-polyfill-module-data.js but I still don't understand why this is unused

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done, is it clear now?

Copy link
Contributor

Choose a reason for hiding this comment

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

ye, thanks

@connorjclark connorjclark merged commit 23d390b into main Mar 12, 2025
27 checks passed
@connorjclark connorjclark deleted the leg-js-baseline branch March 12, 2025 06:27
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.

3 participants