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

Use es.* for stable esnext features #98

Merged
merged 9 commits into from
Sep 2, 2021

Conversation

JLHwung
Copy link
Collaborator

@JLHwung JLHwung commented Aug 24, 2021

Fixes #97

Added a builtin-definition-checker so we don't forget to update it anymore.

@ljharb
Copy link
Member

ljharb commented Aug 24, 2021

Could we add a checker for es-shims also?

@JLHwung JLHwung changed the title Update corejs3 definitions Use es.* for stable esnext features Aug 24, 2021
@JLHwung JLHwung marked this pull request as ready for review August 24, 2021 21:00
@JLHwung
Copy link
Collaborator Author

JLHwung commented Aug 24, 2021

@ljharb Sure, will do it in a separate PR.

Copy link
Member

@zloirock zloirock left a comment

Choose a reason for hiding this comment

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

IIRC logic of falling back es. -> esnext. had some problems, could you add tests for that?

@@ -128,7 +132,7 @@ _reduceRightInstanceProperty(object);

_repeatInstanceProperty(object);

object.replaceAll;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the replaceAll is stage 4, we should polyfill it if users are using an older version of corejs which provides esnext.string.replace-all.

@JLHwung JLHwung requested a review from zloirock August 25, 2021 19:05
@@ -104,13 +107,31 @@ export default defineProvider<Options>(function(
!(object && desc.exclude && desc.exclude.includes(object)) &&
esnextFallback(desc.name, shouldInjectPolyfill)
) {
const { name } = desc;
let useProposalBase = false;
if (proposals || name.startsWith("es.next")) {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like a typo.

@@ -109,7 +109,7 @@ export default defineProvider<Options>(function(
) {
const { name } = desc;
let useProposalBase = false;
if (proposals) {
if (proposals || (shippedProposals && name.startsWith("esnext."))) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

name.startsWith("esnext.") is always false when both proposals and shippedProposals are not enabled.

@JLHwung JLHwung merged commit c66efb6 into babel:main Sep 2, 2021
@JLHwung JLHwung deleted the update-corejs3-definitions branch September 2, 2021 18:23
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.

(corejs3) "".replaceAll not being polyfilled in Node v14 LTS
4 participants