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

fix(es/preset-env): update data.rs for core-js3 #7023

Merged
merged 11 commits into from Mar 11, 2023

Conversation

nissy-dev
Copy link
Contributor

@nissy-dev nissy-dev commented Mar 6, 2023

Description:

I updated data.rs for core-js3 based on https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts

see: #7012 (comment)

BREAKING CHANGE:

Related issue (if exists): #7012

includes: ["es.array.includes", "es.string.includes"],
indexed: INDEXED,
Copy link

Choose a reason for hiding this comment

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

.indexed was removed from the iterators helpers proposal, so it makes no sense to add it.

indexOf: ["es.array.index-of"],
italics: ["es.string.italics"],
isWellFormed: ["esnext.string.is-well-formed"],
italic: ["es.string.italics"],
Copy link

Choose a reason for hiding this comment

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

italics

import "core-js/modules/es.typed-array.to-string.js";
import "core-js/modules/es.typed-array.with.js";
Copy link

Choose a reason for hiding this comment

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

It's strange that it's added here since I see just corejs: 3 without specifying a minor version where those modules were added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted 👍

@kdy1 kdy1 self-assigned this Mar 7, 2023
@@ -425,28 +476,33 @@ pub static INSTANCE_PROPERTIES: DataMap<&[&str]> = data_map!(Map {
getYear: "es.date.get-year",
groupBy: "esnext.array.group-by",
groupByToMap: ["esnext.array.group-by-to-map", "es.map", "es.object.to-string"],
groupToMap:["esnext.array.group-to-map", "es.map", "es.object.to-string"],
Copy link

Choose a reason for hiding this comment

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

.group is missing.

trim: ["es.string.trim"],
trimEnd: ["es.string.trim-end"],
trimLeft: ["es.string.trim-start"],
trimRight: ["es.string.trim-end"],
trimStart: ["es.string.trim-start"],
uniqueBy: ["esnext.array.unique-by", "es.map"],
unshift: ["es.array.unshift"],
unThis: "esnext.function.un-this",
values: ARRAY_NATURE_ITERATORS_WITH_TAG,
with: "esnext.array.with",
Copy link

Choose a reason for hiding this comment

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

es.array.with

toSorted: ["esnext.array.to-sorted", "es.array.sort"],
toSpliced: "esnext.array.to-spliced",
toSorted: ["es.array.to-sorted", "es.array.sort"],
toSpliced: "es.array.to-spliced",
Copy link

Choose a reason for hiding this comment

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

.toReversed is missing.

@kdy1 kdy1 added this to the Planned milestone Mar 7, 2023
@nissy-dev nissy-dev marked this pull request as ready for review March 10, 2023 15:08
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Thank you!


swc-bump:

  • swc_ecma_preset_env

@kdy1 kdy1 enabled auto-merge (squash) March 11, 2023 00:25
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit 3730463 into swc-project:main Mar 11, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.40 Mar 13, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants