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

When to make --default-type=module the Node.js default #1445

Closed
GeoffreyBooth opened this issue Oct 1, 2023 · 72 comments
Closed

When to make --default-type=module the Node.js default #1445

GeoffreyBooth opened this issue Oct 1, 2023 · 72 comments
Labels

Comments

@GeoffreyBooth
Copy link
Member

Now that nodejs/node#49869 has landed, and we need to figure out what to say about it for the 21.0.0 announcement, we should agree on a tentative plan for when the default value of --default-type flips from commonjs to module. That would be a semver-major change.

Obviously we can’t announce a certain date or version, since we don’t know what issues may arise during 21.x as people test out --experimental-default-type=module and when we might consider it stable, but assuming things go fairly smoothly then we could conceivably make the flip in 22.0.0 in April 2024. I think that would probably be preferable to 23.0.0 in October 2024, which would mean that the first LTS line with ESM by default wouldn’t begin until 24.x in April 2025, which is a long way off.

I think for the health of the project and the greater JavaScript ecosystem it’s important for Node.js to shift to an ESM-first mindset. We will continue to support CommonJS as a first-class module system, but it becomes opt-in rather than opt-out, conforming Node with other runtimes and modern tools.

This is primarily a change for new users. Most users learning JavaScript today are learning it with import/export syntax and get frustrated when Node doesn’t run their code right away without messing with configuration settings. I think it’s important that we prioritize the UX of these users. The users still writing CommonJS today are among our most sophisticated and experienced, and will be able to figure out how to opt into the old mode via --default-type or the "type" field.

@GeoffreyBooth
Copy link
Member Author

For those wondering, this is what the migration paths look like:

  • For users already writing ESM, either via package.json "type": "module" or .mjs, nothing needs to be done.

  • For users writing CommonJS apps or libraries, where their code is in a folder that has a package.json file, they would need to add "type": "commonjs" to that package.json file if they haven’t already; or run Node with --default-type=commonjs.

  • For users writing “loose” .js or extensionless JavaScript files, that have no package.json file in the folder alongside them or in any parent folder, the user would need to do one of the following:

    • Add a package.json file with "type": "commonjs".
    • Rename the file to end in .cjs.
    • Make the path of the file into a symlink to a file that either ends in .cjs or is under a folder with a package.json file with "type": "commonjs".
    • If the file is an executable script with a shebang line and their system supports env with the -S option, change the shebang to #!/usr/bin/env -S node --default-type=commonjs.
    • Use some shell scripting to have the script passed to Node via STDIN with --input-type=commonjs.

Or, of course, they could refactor code from CommonJS to ESM, but I’m not sure that needs to be presented as an option. This is nothing like Python 2 to 3.

The other significant migration is of packages that rely on monkey-patching the CommonJS loader. The authors of major instrumentation libraries and of Yarn Plug-n-Play have been very active engaging with the loaders team in ensuring that the module customization hooks can be used to support their use cases. Those APIs are already in “release candidate” stage, just baking to see if anyone reports any bugs before we declare them stable. Regardless of the --default-type flip, though, it’s important for the maintainability of the modules subsystem that anyone who currently monkey-patches moves away from that pattern and onto public APIs. The need to support monkey-patching use cases has severely hampered our ability to do significant refactoring or improvements of the modules code. Substantial performance achievements, such as could be attained by moving parts of the modules code into C++, can only be done if we can break the already unsupported monkey-patching use cases. Having an official announcement that the ESM loader will become the default module loader in a future Node version will hopefully be what corporate teams need to prioritize the work to move away from monkey-patching.

@ljharb
Copy link
Member

ljharb commented Oct 1, 2023

Doesn’t this mean that users writing a library would have different default behavior for themselves than for when they’re installed in someone else’s node_modules?

@mcollina
Copy link
Member

mcollina commented Oct 1, 2023

Doesn’t this mean that users writing a library would have different default behavior for themselves than for when they’re installed in someone else’s node_modules?

Yes. I think changing that is going to a be a massive breaking change that would break everybody. Most modules would need to keep working with the flag.

Other alternatives are

  1. deprecate typeless packages outside of node_modules
  2. ask npm init and the like to include a type property by default

I would personally prefer to ship this in 23, having v24 the first LTS with the change, but I'm not opposed to an accelerated timeline.

If we decide not to flip the switch in v22, we could ship some form of warning in v22 for typeless packages outside of node_modules, taking a similar "iteration" approach that we used in the past.

Something to consider is the coordination with the TS team, as this will impact them and their resolution algorithms.

Of course, Loaders should be stable by then and no critical bugs should be there (or in ESM) to do the switch.

@GeoffreyBooth
Copy link
Member Author

GeoffreyBooth commented Oct 1, 2023

Yes. I think changing that is going to a be a massive breaking change that would break everybody. Most modules would need to keep working with the flag.

Let’s investigate this, shall we? Let’s go through some scenarios:

  1. ESM-only packages, like node-fetch: The flip has no effect, on either the package author or its consumers.

  2. CommonJS-only packages, like express, where the author is developing the package using a pre-flip version of Node and the consumer is running post-flip Node: The flip has no effect, on either the package author or its consumers.

  3. CommonJS-only packages, like express, where the author upgrades to the post-flip version of Node. Assume that the package uses .js extensions and the package.json file has no type field: The first time the author tries to develop their package after upgrading, it will fail to load because .js is ESM now. The error message will prompt the author to add "type": "commonjs" to their package.json. The author does so and is back to developing. No effect on consumers of the package.

  4. A new ESM-only package, where the author starts writing the library in .js files with a package.json file that has no "type" field: (Assume for the sake of evaluating worst case scenarios that we get no help from npm or build tools; they function as they do today.) The author publishes their package to npm, thinking all is fine, but any consumers of the package—both using pre- and post-flip versions of Node—see errors when they try to consume it, because in all versions of Node a type-less package under node_modules is interpreted as CommonJS. This published version of the package is effectively broken for all users, which would surely trickle back to the author, who would add "type": "module" to the package.json and publish a new version that would work for everyone. Because this is a new package, it wouldn’t have millions of consumers; the mistake would be rectified very early on, before it has a chance to grow its popularity.

So basically, package authors would need to learn to add the type field to their package.json files, and hopefully we get some help from npm or other tools reminding them to do so. But the consequences of them forgetting to do so are low: a package either works for all users or is broken for all users, which is really what we want, because broken versions won’t find any adoption. I don’t see any scenarios where either authors or consumers would use --default-type=commonjs; it’s easier and more permanent to just add "type": "commonjs". Are there any other plausible scenarios I haven’t thought of?

@benjamingr
Copy link
Member

benjamingr commented Oct 1, 2023

Excellent summary @GeoffreyBooth that really clarified how migration would look and it sounds very reasonable.

We should also contact npm and ask for:

  • Adding "type": "module" by default to npm init (as suggested by Matteo)
  • Check that type is defined in the package.json during npm publish

@nodejs/npm does that sound reasonable?

Edit: opened an issue with npm: npm/cli#6855

@GeoffreyBooth
Copy link
Member Author

GeoffreyBooth commented Oct 1, 2023

We should also contact npm

For reference, adding type to npm init was proposed and rejected in 2019, then proposed and rejected again in 2021, then proposed again in 2022 (still open) and again in 2023. Of course, all of those prior discussions happened before the proposal of Node changing its default, so I am optimistic that a new outcome might be possible once we make an announcement on our side.

@wraithgar
Copy link

Am I following this correctly, that every package that's currently published will stop working once this goes into effect, and only newer versions of those packages that have this field defined will work?

@benjamingr
Copy link
Member

benjamingr commented Oct 2, 2023

@wraithgar no, the issue is with the default changing outside node_modules, the issue is when people publish new versions of packages without specifying type and relying on the default being esm - which is why we want the small npm enhancement to let people know their published code requires "type" to work as it did before publishing.

@joyeecheung
Copy link
Member

I think this means if you have a simple script like this:

// test.js
require('fs')

This would stop working once the flag is flipped, unless you change the file name or add a package.json. I believe there is an enormous amount of utility scripts and tutorial examples that would be affected, now the question is do we want to create this havoc in all those scripts already out there and create a python2-like situation...

@joyeecheung
Copy link
Member

joyeecheung commented Oct 2, 2023

Also, wouldn't this break most of our tests unless we do something? (and to that extent, it could probably break a lot of other tests in other projects that are run in a similar "loose" fashion). It could also force all projects not yet migrated to do something, while we already know that there are a lot of simple projects that are not actively maintained but are still heavily depended upon in the ecosystem - or the Node.js ecosystem once favored very simple packages like this, so if an author has tons of very simple packages that do not need much maintenance since Node.js v0.x days (because who would've thought that Node.js is going to break such simple use cases), they will now be forced to update all these small packages. And many of the old reproductions of confirmed bugs would also need updating...

@GeoffreyBooth
Copy link
Member Author

Also, wouldn’t this break most of our tests unless we do something? (and to that extent, it could probably break a lot of other tests in other projects that are run in a similar “loose” fashion). It could also force all projects not yet migrated to do something,

The “do something” is what I wrote above as the migration path for CommonJS projects with no type field: add "type": "commonjs" to package.json, or create a package.json containing only { "type": "commonjs" }. That’s it.

People seem to keep pointing at Python 2-3 as the only example of a migration, but this is nothing like that: that required everyone to refactor their code, whereas this requires no one to refactor their code. They can if they want to, but this is a configuration change not a syntax change.

Yes the “shell scripts” case is the most awkward, because people often lack package.json files for those. But as I’ve written elsewhere, those scripts aren’t our primary use case and they shouldn’t be prioritized over application developers. Per https://nodejs.org/en/about, “Node.js is designed to build scalable network applications.” Just about every application framework has instructions in ESM syntax. TypeScript has exclusively supported ESM syntax since its inception, if I’m remembering correctly. We’re more out of sync with the ecosystem by requiring ESM to be opt-in than opt-out; while there will be some old tutorials and examples that become outdated after this change, there is far more that’s the reverse. Having that code work by default in Node.js will improve the new user experience and bring us into conformity with the broader ecosystem.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 2, 2023

that required everyone to refactor their code, whereas this requires no one to refactor their code

Requiring everyone to add a new file or change file name is no less a problem, I would say, especially considering:

  1. A lot of tools that run scripts would need to take this into account
  2. git history problems and 404-like problems caused by bulk file renames
  3. It really doesn't matter what needs to be changed. A lot of the times people run into issues in their dependencies and they just have no idea how to deal with them and do not want to invest the time. They only want simple things to keep working without breakages i.e. stability. Any change that affects what the hello world everywhere tells you to do is disruptive.

Per https://nodejs.org/en/about, “Node.js is designed to build scalable network applications.”

First of all I don't think whatever we put down on that web page is regarded as our principal. There are also a lot of things on that web page is out of sync with how Node.js is used in the wild. Also on that note, the hello world on that page is still using ComomnJS.

Second of all, claiming that "Node.js is designed to build scalable network applications." does not mean Node.js is only designed for that and we should disregard other use cases, for example, tooling. Also, can one lose the ability to build a scalable network application just because the default entry type stays the way it is since >10 years ago? I doubt how much difference the default entry type makes if that's the only thing we ever care about.

But as I’ve written elsewhere, those scripts aren’t our primary use case and they shouldn’t be prioritized over application developers.

I think above all Node.js prioritizes stability and not breaking existing code unless absolutely necessary.

while there will be some old tutorials and examples that become outdated after this change

Running a .js file that allows you to use require() to load builtins is something that Node.js supports since >10 years ago, it's everywhere in the tutorials and blog posts and books, and it has also been in our hello world examples since the initial days of Node.js. There are very few things that can be even more stable than this in the Node.js API contract. I don't think they are just "some old tutorials", personally I'd be convinced that > 80% of the Node.js tutorials out there still teach you to do this and maybe only 10% of them can ever be updated. There would be countless people counting on this to continue to work. I don't think this should be simply dismissed as "not something worth to be prioritized".

@joyeecheung
Copy link
Member

joyeecheung commented Oct 2, 2023

Out of curiosity, I googled "get started with Node.js", and the top results all rely on being able to run a .js file that require():

  1. https://nodejs.org/en/docs/guides/getting-started-guide
  2. https://www.w3schools.com/nodejs/nodejs_get_started.asp
  3. https://www.freecodecamp.org/news/introduction-to-nodejs/
  4. https://www.simplilearn.com/tutorials/nodejs-tutorial/getting-started-with-nodejs
  5. https://nodejs.dev/en/learn/
  6. https://www.pluralsight.com/guides/getting-started-with-nodejs
  7. https://code.visualstudio.com/docs/nodejs/nodejs-tutorial (assumed in screenshots)
  8. https://levelup.gitconnected.com/the-ultimate-guide-to-get-started-with-node-js-4ce54579ceb7
  9. https://cloud.google.com/nodejs/getting-started (it's actually started by google cloud, I think cloud providers need to go through the hurdle of upgrading their infra and documentations for that change too, it would be even messier factoring in support for multiple Node.js versions)
  10. https://developer.ibm.com/learningpaths/get-started-nodejs/explore-nodejs-concepts/
  11. https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/development_environment

I've stopped looking after glancing over the top few and none of them is teaching people to write the entry type as ESM (I didn't scroll to bottom or click around, but at least CommonJS is always the first thing being taught). And this is just the English version...

@GeoffreyBooth
Copy link
Member Author

Yes, many guides to Node.js were written a long time ago. Most people don’t develop “Node apps” per se anymore, they develop in frameworks that build on Node, or with things like TypeScript that use Node. If you look at those docs, most use ESM syntax. @mhdawson do we have any survey data to put some numbers on how people use Node, or what they use it with, or what their preferences are regarding modules?

Here’s what happens if you use ESM in a CommonJS context today:

mkdir test && cd test
echo 'import "fs"' > entry.js
node entry.js
(node:51228) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

This would be the inverse experience when we flip the default, in that the message would say something like “Warning: To load a CommonJS module, set "type": "commonjs" in the package.json or use the .cjs extension.” It’s to the point and tells you how to fix your problem. It’s not like the code runs but there are silent errors or unexpected behaviors. We should probably improve this by adding a link to a nodejs.org page explaining in more detail, but even the brief version tells you what to do.

A lot of the times people run into issues in their dependencies and they just have no idea how to deal with them and do not want to invest the time. They only want simple things to keep working without breakages i.e. stability. Any change that affects what the hello world everywhere tells you to do is disruptive.

Because the new mode doesn’t affect anything under node_modules, any dependencies installed through common methods like npm install would be unaffected by the flip.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 2, 2023

Most people don’t develop “Node apps” per se anymore, they develop in frameworks that build on Node, or with things like TypeScript that use Node.

I don't think we should base our decision of such a wide-spread breakage on pure impressions. We need evidence that this is not going to break, say, more than 5% of Node.js users (no matter they are writing code in a framework, or just using Node.js as a runner/tool, or using Node.js inside another environment e.g. cloud provider, desktop environment, or using Node.js to run mod/plugin script), before we can break an API contract that has been by design for >10 years.

Because the new mode doesn’t affect anything under node_modules, any dependencies installed through common methods like npm install would be unaffected by the flip.

By dependencies, I mean that the Node.js application is used as a runner/build tool/a component as part of the project, while developers/users do not necessarily know how to deal with it (e.g. our configure.py kind of use case).

@GeoffreyBooth
Copy link
Member Author

I found the data: https://github.com/nodejs/next-10/tree/main/surveys/2023-04

image image image image image

And in https://github.com/nodejs/next-10/blob/main/surveys/2023-04/Node.js%20Survey%20open%20ended%20answers.pdf, question 18 is “If you wish to use ESM in an existing application, what have been the pain points or blockers preventing you from doing so (if
any)?” and there are hundreds of responses so it’s not really summarizable, but you can get a sense from the responses of what people are trying to do.

@benjamingr
Copy link
Member

I don't think the comparison to Python is fair at all. This is like Python 2/3 if Python 2 code kept working.

Namely:

  • In Python 2 -> 3, old Python code and libraries had to be migrated - this is not the case here. Node.js wiil keep running CJS code it just won't be the default. Packages and dependences won't break etc.
  • Users had outdated resources in tutorials - this is not the case here both because the language isn't changing only the module system is and because the fix (literally adding a line to a file or passing a CLI flag) will be helpfully shown to the user if they forget it.
  • It caused ecosystem fragmentation - which this change won't do by design.

Python 2->3 would have been if we removed CJS entirely, removed all the non-promise callback APIs, removed all deprecated APIs and made breaking changes to promise ones and then created an incompatible Node.js binary effectively making "two Nodes". This on the other hand is just changing the default outside node_modules

@joyeecheung
Copy link
Member

joyeecheung commented Oct 2, 2023

I found the data: https://github.com/nodejs/next-10/tree/main/surveys/2023-04

I do not think the survey is created in a way that gathers data about how a widespread breakage in the existing code matter for users. It is true that people may want and do work on transitions when they have time, but it is also true that widespread breakages are disruptive and must be done with care. The right questions should be:

  1. Are you still maintaining CommonJS code?
  2. Would you accept a change that breaks running node hello.js when hello.js is a CommonJS entry point that require() without a package.json, in order to speed up adoption of ESM?
  3. Would you accept other breakages in existing CommonJS applications in order to speed up adoption of ESM?
  4. When do you think is the right time to make ESM the default entry type by breaking the existing way of running CommonJS applications?

Even in the survey, you can see that more than 30% of the respondents do not plan to migrate to ESM in the near future. I doubt how many of our users would be happy to trade a breakage in a widespread way of running CommonJS in order to speed up migration to ESM. It's not impossible to do forever, but I think we are still very far away from that point. If this only breaks running loose CommonJS files, and if that was really just a niche use case as you described, how much value would this actually bring to the speedup of ESM migration and why is it so urgent that it need to be done in a year? Either this is very widespread and moving on would be an important milestone, or this is just a niche use case so this is one of the last thing that needs to be taken care of. I don't think it can be both niche and an important milestone.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 3, 2023

Yes, many guides to Node.js were written a long time ago.

If you check the search results, many of them are either written or updated within the last two years.

Most people don’t develop “Node apps” per se anymore, they develop in frameworks that build on Node, or with things like TypeScript that use Node.

If that's really the case, why would it matter how we run the loose scripts by default? The frameworks should take care of this for them and how the entry point is interpreted by default is the last thing they need to care about. This is also contradicting what the OP says:

This is primarily a change for new users. Most users learning JavaScript today are learning it with import/export syntax and get frustrated when Node doesn’t run their code right away without messing with configuration settings.

Either most users get started by running a loose script and need to configure something to make it run as ESM by default, or they get started by writing code using some framework and the configuration should be done by the framework. I very much doubt how many JavaScript tutorials would teach readers to run ESM code in Node.js without any extra configuration and let them assume that it would just work, but we have evidence that most top Node.js tutorials are still explicitly teaching people to write a CommonJS entry point and run it without any additional configuration. I don't think we should invalidate existing working tutorials to prioritize non-working tutorials that may or may not even exist. Following a tutorial and finding out that what it says can run does not actually run is much more frustrating than trying out code in an environmnet that the tutorials do not teach (because it's in fact not runnable) and finding out that it doesn't work.

@GeoffreyBooth
Copy link
Member Author

If you want to, you can make any conclusions you want from that survey data. You could look at the 65-35 split of users already using ESM and say that more than two-thirds of our users are already using ESM, why shouldn’t it be the default? Or you could look at the 35% and say but this is still a large group, too large to inconvenience, etc.

I think one fair conclusion that can be drawn is that this data does prove that far and away our users are application developers. They may run some loose shell scripts, but by and large I think it’s safe to assume that the vast majority of our users are probably doing most of their Node development in apps with a package.json file and dependencies in node_modules. These users either won’t notice the default flip (if they’re in the 65-70% of ESM users) or they’ll have to add "type": "commonjs" to package.json.

I do not think the survey is created in a way that gathers data about how a widespread breakage in the existing code matter for users.

I think the framing of “widespread breakage” or “Would you accept a change that breaks” or “Would you accept other breakages” is very leading. Not all breaks are created equal. As @benjamingr wrote, there’s a big difference between adding "type": "commonjs" to package.json and refactoring from Python 2 to 3. And besides, we’re not in a position to run another 1000-plus-person survey again anytime soon. This is the data we have.

Every breaking change, like any change, has costs and benefits. The question for us is whether the benefits of this one outweigh its costs. I think they do: I think it really matters that Node join the rest of the ecosystem in prioritizing the standard module format, that we provide the best experience for users in that mode, and that we make it easier to write standards-compliant JavaScript. I think the requirement of a one-line JSON file change, or adding a flag, is a very minimal cost to impose on a minority of users in order to realize these benefits.

If you check the search results, many of them are either written or updated within the last two years.

Well then that would imply that they’re still maintained, and if we announce that this change is coming, they’ll be updated before April 2024. Regardless, we can add a link to our own tutorial in the error message that someone would get when they run CommonJS syntax in ESM mode. I don’t view this as a blocker.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 3, 2023

And besides, we’re not in a position to run another 1000-plus-person survey again anytime soon. This is the data we have.

I don't think "we are not going to do a large-scale survey" is a good response for the lack of data to support an important breakage like this. If we can't run a survey anytime soon, then we should wait until we are ready to run another survey, gather data about how breaking the breakages are, before we make a decision to break something that's been working for more than 10 years and in most top Node.js tutorials out there.

I think the requirement of a one-line JSON file change, or adding a flag, is a very minimal cost to impose on a minority of users in order to realize these benefits.

If the weight of this breakage is enough in the prioritization, then it should be a very commonly used thing that would break a lot of people, hence a huge cost. If it only breaks a minority of users, then it should not have much weight in the prioritization and it's not really worth breaking. I don't think it can only have a minimal cost while also bring a lot of weight in the migration.

@joyeecheung
Copy link
Member

Well then that would imply that they’re still maintained, and if we announce that this change is coming, they’ll be updated before April 2024. Regardless, we can add a link to our own tutorial in the error message that someone would get when they run CommonJS syntax in ESM mode. I don’t view this as a blocker.

I think this is a blocker. We need to at least make sure that the top Node.js tutorials out there are teaching people to write ESM by default before we create a sense of emergency, and for example, >90% of our users are ready for the flip. If that doesn't happen, then we should postpone the flip. It's fine to announce that a change is coming, but I think a one-year notice is just too short for breaking something that's been working and assumed everywhere for more than 10 years.

@GeoffreyBooth
Copy link
Member Author

I think what you’re saying is that this is a big deal because it affects so many users; up to a third of our user base. What I’m saying is that it’s a small deal because all it takes is a minute of effort on those users’ part to update their projects to work in the new mode. Both things are true.

If there’s a way to run another survey, sure, that would be great. @mhdawson? But I think we need to write the 21 announcement soon, so I find it hard to imagine we’ll have results in time to inform what we write. Even if we wanted to I don’t think we can promise anything in particular, because no one can predict what PRs get blocked, but I think we can say that we intend to propose flipping the default of --default-type in 22 assuming that the flag is stable by then and issues people report have been resolved. The stronger the statement we make, the more feedback we’ll get; we can even include a survey with the announcement, and that might give us data to make an informed decision by the time 22 is getting ready. And no one will hold us to our intentions; we can always decide that 22 is too early, whatever, and let it slide to 23 or 24.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 3, 2023

I think "we'll flip in 22" is a message that shows how little we care about the stability of this software. This is not a niche API that only a fraction of users know about. It's something that has been working and assumed everywhere for more than 10 years, and it's something that almost all Node.js beginner tutorials out there has been teaching. A one-year notice for that is just too hasty. The message we should give is that "we'll flip when there's sufficient evidence that less than X percent of our users would be affected by the breakage" and ideally send a survey gathering data about the breakage (basically, "if you run the Node.js code you publish or maintain with --default-type=module, would it break?" and "how many dependent of your code would you expect to be broken by this flag?" if the answer is yes).

@GeoffreyBooth
Copy link
Member Author

The message we should give is that “we’ll flip when there’s sufficient evidence that less than X percent of our users would be affected by the breakage”

This kind of statement has no acknowledgement that we’re just changing a default configuration setting, and that it’s easy to continue working in the previous mode if desired. I read phrases like “affected by the breakage” as implying that affected users are just irreparably broken, like they can never upgrade. This is not that.

It does imply that we strongly prefer stability and backward compatibility, which we do, and I think that’s one of Node’s strengths. But a statement that says that we need to wait years to catch up with the ecosystem, to embrace a standard that was released in 2015, makes Node seem hopelessly stagnant and stuck in the past. I’d like to think that we’re a more forward-looking and faster-moving project than that.

I think we can draft a statement along the lines of this:

In 21.0.0 we ship a new flag --experimental-default-type that does {explanation here}. We encourage feedback about the new --experimental-default-type=module mode, and whether it should be made the default in a future major version of Node.js. For users not already writing ES module syntax, the migration paths look like {explanation here}. The ESM mode might become the default as early as 22.0.0 if users don’t report too many issues with the flag and it can go stable by then, and if survey responses indicate that the user base would welcome such a change. Please take this survey to let us know what you think: {link}

@joyeecheung
Copy link
Member

joyeecheung commented Oct 3, 2023

But a statement that says that we need to wait years to catch up with the ecosystem, to embrace a standard that was released in 2015, makes Node seem hopelessly stagnant and stuck in the past.

Even browsers do not support import in a <script> tag without type="module", I would not blame a JS runtime for following what browsers do by default for stability. I think this is just the unfortunate result of the design of the standard, which should've considered the impact before getting released. This is the just reality that we have to live with. I don't think making Node.js less stable by breaking something that's still been widely assumed everywhere is the right answer.

I think we can draft a statement along the lines of this

I would say this statement only looks appropriate when the flag is no longer experimental. It still looks careless to release a timeline for such a widespread breakage based on an experimental feature that just gets out and is not yet even tested in the wild.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 4, 2023

I think given that we do not have consensus about the prospect of this mode, we can also just don't say anything about the future, and just describe what it does, what it breaks, and how to fix the breakages.

@GeoffreyBooth
Copy link
Member Author

Browsers can never change how a script tag works. That’s not a reasonable comparison.

The ecosystem I have in mind is the main large JavaScript projects that people use today: TypeScript, React, Vue, Svelte, Angular, Next, Remix, Nuxt, SvelteKit, etc. The main things that people are using with Node.

I think we have to accept that both we need to make the flip at some point in the future and that interop may not get any better than it currently is. It would always be nice if interop improves, of course, and we’ll work on that, but that’s irrelevant. I think getting to the point of “yes you will have to make this one change and it’ll take you a minute” is already very good, good enough to justify flipping the default.

@ljharb
Copy link
Member

ljharb commented Oct 5, 2023

Yes, but why can't browsers ever change how a script tag works?

Because avoiding breakage is so important that it's a fundamental principle of the web, and because people would stop using a tool that suddenly breaks their workflow.

@MoLow
Copy link
Member

MoLow commented Oct 5, 2023

Browsers are usually automatically updated, and non of them uses semver - A main part of semver is defining when and how to break things.
Also, most users of browsers are non technical, pretty much the opposite. For us that is not the case, I would assume most node users are developers, meaning far more technical than the average browser user.
I don't this comparison with browsers is valid

@ljharb
Copy link
Member

ljharb commented Oct 5, 2023

Don't underestimate how naively people upgrade node, expecting everything to work ¯\_(ツ)_/¯

All of the arguments made in #1445 (comment) to me sound like the technical expertise of node's users as it relates to module systems is perhaps significantly overstated.

@MoLow
Copy link
Member

MoLow commented Oct 5, 2023

I am not saying there won't be brekage, just that not like browsers we have a way of managing breakage.
I do agree that it should be done slowly and with caution.

@benjamingr
Copy link
Member

Yes, but why can't browsers ever change how a script tag works?

Because of the distribution model browsers can't "version" JavaScript like Node.js has versions so they cannot make breaking changes that "break the internet". Additionally, unlike Node.js browsers collect a lot of telemetry so it's easy for them to remove little used or unused features.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 5, 2023

I don't think our way of managing breakage is enough for this kind of breakage. A breakage coping mechanism does not only involve merging a change, releasing it, and announcing it. It also involves evaluation/monitoring of how much the breakage affects users, how we send the message out and promote update in the the ecosystem including educational materials before the breakage, and how we go through the deprecation cycle, and I think we are heavily lacking in those regards for a substantial brekage, especially given the attitude towards breaking top tutorials, the response to the lack of survey data, and having a whimsical conflicting story that involves both "this is too niche a use case to break a lot of people" v.s. "this is an important use case to migrate away from in the transition". I don't think this is how we are supposed to manage breakages.

Speaking of which I am now surprised that we were even talking about "releasing an experimental alternative in version X, and break the default with this alternative in X+1", because even in our existing breakage management system that can be used to deal with less-impactful breakages, breaking the default involves a full documentation-warning-breakage cycle, one would've designed any change that's impactful to be at least "releasing an experimental alternative in version X, graduating the alternative in X+1 and doc-deprecate the original, runtime deprecation in X+2, breakage in X+3" (and this is already the fastest track, the alternative may need more than one major cycle for polishing for example), this explained why I felt that the proposal was just too hasty in general and it did not adhere to our stability model.

@Shinigami92
Copy link

I would absolutely LOVE if commonjs is forced to define it in the package.json instead of esm needs it right now
esm should be the default and commonjs should get finally outdated

@GeoffreyBooth
Copy link
Member Author

“releasing an experimental alternative in version X, graduating the alternative in X+1 and doc-deprecate the original, runtime deprecation in X+2, breakage in X+3”

So version X here is 21, so therefore X+3 = 24, or April 2025. That feels like a long time to wait. I think this situation is a bit different than something like deprecating new Buffer, in that there are users suffering now in the status quo, and this change would help them. This is also a situation where users aren’t acting in a vacuum; the current pain is because of how various dependencies and libraries and tools interact, so the solution has to involve at least some amount of collective action. The question is how do we effectively encourage the changes that various actors need to make to ease the pain for everyone.

We could add a runtime deprecation for when an entry point is run and there’s a package.json found that controls it, and that package.json lacks a type field. This would be a push to get everyone to add the type field and future-proof their apps or libraries. It wouldn’t apply to dependencies, and it wouldn’t apply to loose scripts that lack a package.json, so it would be pretty targeted. Such a warning would be a bit odd in that it’s not like we’re planning to remove support for typeless package.json files, but I guess a deprecation could be for a change and not just a removal? Though a deprecation warning would imply that we’ve made a decision about the future?

@jasnell
Copy link
Member

jasnell commented Oct 5, 2023

It's far too dangerous for us to set any expectations around when any hypothetical switch to ESM-by-default could happen but we absolutely should experiment with it. I'd suggest we just start there -- enable an experimental flag that switches the default so we and the ecosystem can start testing.

@GeoffreyBooth
Copy link
Member Author

GeoffreyBooth commented Oct 5, 2023

I’m encouraged by the response to nodejs/node#50043; if that proposal succeeds, then that new detect-module mode would be a better candidate for a future default than module, as it avoids the breaks that @joyeecheung and others have voiced concerns about on this thread. So I think we can table this discussion for now until we see how that turns out.

I also think that --default-type=detect-module becoming Node’s default wouldn’t be a semver-major change? It only affects cases that currently error: entry points in an implicit CommonJS scope that contain unambiguously ESM syntax. So really it could become Node’s default as soon as we think it’s stable, and we can avoid the question of breaking changes.

@GeoffreyBooth
Copy link
Member Author

GeoffreyBooth commented Oct 8, 2023

I added nodejs/node#50064 to the TSC agenda. If it or the alternative nodejs/node#50043 can land, then we can avoid most if not all of the downsides discussed on this thread.

Basically there are three potential ways forward to get to the goal of Node running ESM code by default with no opt-in:

nodejs/node#50043 builds on --experimental-default-type but nodejs/node#50064 does not. If we land the latter, I would think we would probably remove the --experimental-default-type flag. It wouldn’t have a purpose.

So the question for the TSC is just:

If that seems like the most promising option, we should probably pause on promoting --experimental-default-type until we know whether or not nodejs/node#50064 will pan out.

@tniessen
Copy link
Member

tniessen commented Oct 9, 2023

I added nodejs/node#50064 to the TSC agenda.

So the question for the TSC is just:

Why is that a question for the TSC at this point? Any collaborator, including TSC members, may object to PRs, and any discussion should happen through GitHub by default. I assume that some of the most knowledgeable folks in this area are not TSC members either.

@GeoffreyBooth
Copy link
Member Author

Why is that a question for the TSC at this point? Any collaborator, including TSC members, may object to PRs

Well the TSC are collaborators too, so if any TSC members object, then that begins the discussion around overcoming objections. The only objectors to setting --default-type=module as the new default have been from the TSC, so this seems like the logical place to start.

There’s also a strong “steering the direction of the project” aspect to this. I’ve repeatedly asked in TSC meetings if we agree that Node should support ESM syntax by default, and the answer has always been that we do. So on some level it’s on the TSC to reach a consensus (or vote) on how to make that happen. All of the options have tradeoffs, and the TSC has rejected the first approach that grew out of a weekslong process that arrived at a consensus in nodejs/node#49432, so I view the TSC as responsible for finding a solution that we can accept.

@aduh95
Copy link
Contributor

aduh95 commented Oct 9, 2023

so I view the TSC as responsible for finding a solution that we can accept.

The TSC will very likely defer to the collaborators unless consensus cannot be reached, per the usual procedure.

the TSC has rejected the first approach that grew out of a weekslong process that arrived at a consensus in nodejs/node#49432

That's not what has happened, AFAIK the TSC has not taken any decision regarding this.

@GeoffreyBooth
Copy link
Member Author

GeoffreyBooth commented Oct 9, 2023

We can take it off the agenda if people want, if I can get an answer async. All I want to know is if there are likely to be objections to one or the other of the new proposals (nodejs/node#50043, nodejs/node#50064). I haven’t gotten any objections from the loaders team, so I just want to know if anyone feels like they’re likely to object based on what’s described here, before we invest a lot of effort into one or the other.

zloirock added a commit to zloirock/core-js that referenced this issue Oct 17, 2023
…o avoid potential breakage in future Node versions

nodejs/TSC#1445
Vylpes pushed a commit to Vylpes/Droplet that referenced this issue Dec 25, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [core-js](https://github.com/zloirock/core-js) | dependencies | minor | [`3.12.0` -> `3.34.0`](https://renovatebot.com/diffs/npm/core-js/3.12.0/3.34.0) |

---

### Release Notes

<details>
<summary>zloirock/core-js (core-js)</summary>

### [`v3.34.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3340---20231206)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.33.3...v3.34.0)

-   [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping):
    -   Methods:
        -   `Object.groupBy`
        -   `Map.groupBy`
    -   Moved to stable ES, [November 2023 TC39 meeting](https://github.com/tc39/proposal-array-grouping/issues/60)
    -   Added `es.` namespace modules, `/es/` and `/stable/` namespaces entries
-   [`Promise.withResolvers` proposal](https://github.com/tc39/proposal-promise-with-resolvers):
    -   Method:
        -   `Promise.withResolvers`
    -   Moved to stable ES, [November 2023 TC39 meeting](https://twitter.com/robpalmer2/status/1729216597623976407)
    -   Added `es.` namespace module, `/es/` and `/stable/` namespaces entries
-   Fixed a web incompatibility issue of [`Iterator` helpers proposal](https://github.com/tc39/proposal-iterator-helpers), [proposal-iterator-helpers/287](https://github.com/tc39/proposal-iterator-helpers/pull/287) and some following changes, November 2023 TC39 meeting
-   Added [`Uint8Array` to / from base64 and hex stage 2 proposal](https://github.com/tc39/proposal-arraybuffer-base64):
    -   Methods:
        -   `Uint8Array.fromBase64`
        -   `Uint8Array.fromHex`
        -   `Uint8Array.prototype.toBase64`
        -   `Uint8Array.prototype.toHex`
-   Relaxed some specific cases of [`Number.fromString`](https://github.com/tc39/proposal-number-fromstring) validation before clarification of [proposal-number-fromstring/24](https://github.com/tc39/proposal-number-fromstring/issues/24)
-   Fixed `@@&#8203;toStringTag` property descriptors on DOM collections, [#&#8203;1312](https://github.com/zloirock/core-js/issues/1312)
-   Fixed the order of arguments validation in `Array` iteration methods, [#&#8203;1313](https://github.com/zloirock/core-js/issues/1313)
-   Some minor `atob` / `btoa` improvements
-   Compat data improvements:
    -   [`Promise.withResolvers`](https://github.com/tc39/proposal-promise-with-resolvers) marked as shipped from FF121

### [`v3.33.3`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3333---20231120)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.33.2...v3.33.3)

-   Fixed an issue getting the global object on Duktape, [#&#8203;1303](https://github.com/zloirock/core-js/issues/1303)
-   Avoid sharing internal `[[DedentMap]]` from [`String.dedent` proposal](https://github.com/tc39/proposal-string-dedent) between `core-js` instances before stabilization of the proposal
-   Some internal untangling
-   Compat data improvements:
    -   Added [Deno 1.38](https://deno.com/blog/v1.38) compat data mapping
    -   [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async) marked as [supported from Deno 1.38](https://github.com/denoland/deno/pull/21048)
    -   [`Symbol.{ dispose, asyncDispose }`](https://github.com/tc39/proposal-explicit-resource-management) marked as [supported from Deno 1.38](https://github.com/denoland/deno/pull/20845)
    -   Added Opera Android 79 compat data mapping
    -   Added Oculus Quest Browser 30 compat data mapping
    -   Updated Electron 28 and 29 compat data mapping

### [`v3.33.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3332---20231031)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.33.1...v3.33.2)

-   Simplified `structuredClone` polyfill, avoided second tree pass in cases of transferring
-   Added support of [`SuppressedError`](https://github.com/tc39/proposal-explicit-resource-management#the-suppressederror-error) to `structuredClone` polyfill
-   Removed unspecified unnecessary `ArrayBuffer` and `DataView` dependencies of `structuredClone` lack of which could cause errors in some entries in IE10-
-   Fixed handling of fractional number part in [`Number.fromString`](https://github.com/tc39/proposal-number-fromstring)
-   Compat data improvements:
    -   [`URL.canParse`](https://url.spec.whatwg.org/#dom-url-canparse) marked as [supported from Chromium 120](https://bugs.chromium.org/p/chromium/issues/detail?id=1425839)
    -   Updated Opera Android 78 compat data mapping
    -   Added Electron 29 compat data mapping

### [`v3.33.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3331---20231020)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.33.0...v3.33.1)

-   Added one more workaround of possible error with `Symbol` polyfill on global object, [#&#8203;1289](https://github.com/zloirock/core-js/issues/1289#issuecomment-1768411444)
-   Directly specified `type: commonjs` in `package.json` of all packages to avoid potential breakage in future Node versions, see [this issue](https://github.com/nodejs/TSC/issues/1445)
-   Prevented potential issue with lack of some dependencies after automatic optimization polyfills of some methods in the pure version
-   Some minor internal fixes and optimizations
-   Compat data improvements:
    -   [`String.prototype.{ isWellFormed, toWellFormed }`](https://github.com/tc39/proposal-is-usv-string) marked as [supported from FF119](https://bugzilla.mozilla.org/show_bug.cgi?id=1850755)
    -   Added React Native 0.73 Hermes compat data, mainly fixes of [some issues](https://github.com/facebook/hermes/issues/770)
    -   Added [NodeJS 21.0 compat data mapping](https://nodejs.org/ru/blog/release/v21.0.0)

### [`v3.33.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3330---20231002)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.32.2...v3.33.0)

-   Re-introduced [`RegExp` escaping stage 2 proposal](https://github.com/tc39/proposal-regex-escaping), September 2023 TC39 meeting:
    -   Added `RegExp.escape` method with the new set of symbols for escaping
    -   Some years ago, it was presented in `core-js`, but it was removed after rejecting the old version of this proposal
-   Added [`ArrayBuffer.prototype.{ transfer, transferToFixedLength }`](https://github.com/tc39/proposal-arraybuffer-transfer) and support transferring of `ArrayBuffer`s via [`structuredClone`](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone) to engines with `MessageChannel`
-   Optimized [`Math.f16round`](https://github.com/tc39/proposal-float16array) polyfill
-   Fixed [some conversion cases](https://github.com/petamoriken/float16/issues/1046) of [`Math.f16round` and `DataView.prototype.{ getFloat16, setFloat16 }`](https://github.com/tc39/proposal-float16array)
-   Fully forced polyfilling of [the TC39 `Observable` proposal](https://github.com/tc39/proposal-observable) because of incompatibility with [the new WHATWG `Observable` proposal](https://github.com/WICG/observable)
-   Added an extra workaround of errors with exotic environment objects in `Symbol` polyfill, [#&#8203;1289](https://github.com/zloirock/core-js/issues/1289)
-   Some minor fixes and stylistic changes
-   Compat data improvements:
    -   V8 unshipped [`Iterator` helpers](https://github.com/tc39/proposal-iterator-helpers) because of [some Web compatibility issues](https://github.com/tc39/proposal-iterator-helpers/issues/286)
    -   [`Promise.withResolvers`](https://github.com/tc39/proposal-promise-with-resolvers) marked as [supported from V8 ~ Chrome 119](https://chromestatus.com/feature/5810984110784512)
    -   [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping) features marked as [supported from FF119](https://bugzilla.mozilla.org/show_bug.cgi?id=1792650#c9)
    -   [`value` argument of `URLSearchParams.prototype.{ has, delete }`](https://url.spec.whatwg.org/#dom-urlsearchparams-delete) marked as properly supported from V8 ~ Chrome 118
    -   [`URL.canParse`](https://url.spec.whatwg.org/#dom-url-canparse) and [`URLSearchParams.prototype.size`](https://url.spec.whatwg.org/#dom-urlsearchparams-size) marked as [supported from Bun 1.0.2](https://github.com/oven-sh/bun/releases/tag/bun-v1.0.2)
    -   Added Deno 1.37 compat data mapping
    -   Added Electron 28 compat data mapping
    -   Added Opera Android 78 compat data mapping

### [`v3.32.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3322---20230907)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.32.1...v3.32.2)

-   Fixed `structuredClone` feature detection `core-js@3.32.1` bug, [#&#8203;1288](https://github.com/zloirock/core-js/issues/1288)
-   Added a workaround of old WebKit + `eval` bug, [#&#8203;1287](https://github.com/zloirock/core-js/pull/1287)
-   Compat data improvements:
    -   Added Samsung Internet 23 compat data mapping
    -   Added Quest Browser 29 compat data mapping

### [`v3.32.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3321---20230819)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.32.0...v3.32.1)

-   Fixed some cases of IEEE754 rounding, [#&#8203;1279](https://github.com/zloirock/core-js/issues/1279), thanks [**@&#8203;petamoriken**](https://github.com/petamoriken)
-   Prevented injection `process` polyfill to `core-js` via some bundlers or `esm.sh`, [#&#8203;1277](https://github.com/zloirock/core-js/issues/1277)
-   Some minor fixes and stylistic changes
-   Compat data improvements:
    -   [`Promise.withResolvers`](https://github.com/tc39/proposal-promise-with-resolvers) marked as supported [from Bun 0.7.1](https://bun.sh/blog/bun-v0.7.1#bun-ismainthread-and-promise-withresolvers)
    -   Added Opera Android 77 compat data mapping
    -   Updated Electron 27 compat data mapping

### [`v3.32.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3320---20230728)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.31.1...v3.32.0)

-   [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping), July 2023 TC39 meeting updates:
    -   [Moved back to stage 3](https://github.com/tc39/proposal-array-grouping/issues/54)
    -   Added `/actual/` namespaces entries, unconditional forced replacement changed to feature detection
-   [`Promise.withResolvers` proposal](https://github.com/tc39/proposal-promise-with-resolvers), July 2023 TC39 meeting updates:
    -   [Moved to stage 3](https://github.com/tc39/proposal-promise-with-resolvers/pull/18)
    -   Added `/actual/` namespaces entries, unconditional forced replacement changed to feature detection
-   [`Set` methods stage 3 proposal](https://github.com/tc39/proposal-set-methods), July 2023 TC39 meeting updates:
    -   Throw on negative `Set` sizes, [proposal-set-methods/88](https://github.com/tc39/proposal-set-methods/pull/88)
    -   Removed `IsCallable` check in `GetKeysIterator`, [proposal-set-methods/101](https://github.com/tc39/proposal-set-methods/pull/101)
-   [Iterator Helpers stage 3 proposal](https://github.com/tc39/proposal-iterator-helpers):
    -   Avoid creating observable `String` wrapper objects, July 2023 TC39 meeting update, [proposal-iterator-helpers/281](https://github.com/tc39/proposal-iterator-helpers/pull/281)
    -   `Iterator` is not constructible from the active function object (works as an abstract class)
-   Async explicit resource management:
    -   Moved back into [the initial proposal](https://github.com/tc39/proposal-explicit-resource-management) -> moved to stage 3, [proposal-explicit-resource-management/154](https://github.com/tc39/proposal-explicit-resource-management/pull/154)
    -   Added `/actual/` namespace entries, unconditional forced replacement changed to feature detection
    -   Ignore return value of `[@@&#8203;dispose]()` method when hint is `async-dispose`, [proposal-explicit-resource-management/180](https://github.com/tc39/proposal-explicit-resource-management/pull/180)
    -   Added ticks for empty resources, [proposal-explicit-resource-management/163](https://github.com/tc39/proposal-explicit-resource-management/pull/163)
-   Added some methods from [`Float16Array` stage 3 proposal](https://github.com/tc39/proposal-float16array):
    -   There are some reason why I don't want to add `Float16Array` right now, however, make sense to add some methods from this proposal.
    -   Methods:
        -   `Math.f16round`
        -   `DataView.prototype.getFloat16`
        -   `DataView.prototype.setFloat16`
-   Added [`DataView` get / set `Uint8Clamped` methods stage 1 proposal](https://github.com/tc39/proposal-dataview-get-set-uint8clamped):
    -   Methods:
        -   `DataView.prototype.getUint8Clamped`
        -   `DataView.prototype.setUint8Clamped`
-   Used strict mode in some missed cases, [#&#8203;1269](https://github.com/zloirock/core-js/issues/1269)
-   Fixed [a Chromium 117 bug](https://bugs.chromium.org/p/v8/issues/detail?id=14222) in `value` argument of `URLSearchParams.prototype.{ has, delete }`
-   Fixed early WebKit ~ Safari 17.0 beta `Set` methods implementation by the actual spec
-   Fixed incorrect `Symbol.{ dispose, asyncDispose }` descriptors from [NodeJS 20.4](https://github.com/nodejs/node/issues/48699) / transpilers helpers / userland code
-   Fixed forced polyfilling of some iterator helpers that should return wrapped iterator in the pure version
-   Fixed and exposed [`AsyncIteratorPrototype` `core-js/configurator` option](https://github.com/zloirock/core-js#asynciterator-helpers), [#&#8203;1268](https://github.com/zloirock/core-js/issues/1268)
-   Compat data improvements:
    -   Sync [`Iterator` helpers proposal](https://github.com/tc39/proposal-iterator-helpers) features marked as [supported](https://chromestatus.com/feature/5102502917177344) from V8 ~ Chrome 117
    -   [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping) features marked as [supported](https://chromestatus.com/feature/5714791975878656) from V8 ~ Chrome 117
    -   Mark `Symbol.{ dispose, asyncDispose }` as supported from NodeJS 20.5.0 (as mentioned above, NodeJS 20.4.0 add it, but [with incorrect descriptors](https://github.com/nodejs/node/issues/48699))
    -   Added Electron 27 compat data mapping

### [`v3.31.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3311---20230706)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.31.0...v3.31.1)

-   Fixed a `structuredClone` bug with cloning views of transferred buffers, [#&#8203;1265](https://github.com/zloirock/core-js/issues/1265)
-   Fixed the order of arguments validation in `DataView` methods
-   Allowed cloning of [`Float16Array`](https://github.com/tc39/proposal-float16array) in `structuredClone`
-   Compat data improvements:
    -   [`Set` methods proposal](https://github.com/tc39/proposal-set-methods) marked as [supported from Safari 17.0](https://developer.apple.com/documentation/safari-release-notes/safari-17-release-notes#JavaScript)
    -   New `URL` features: [`URL.canParse`](https://url.spec.whatwg.org/#dom-url-canparse), [`URLSearchParams.prototype.size`](https://url.spec.whatwg.org/#dom-urlsearchparams-size) and [`value` argument of `URLSearchParams.prototype.{ has, delete }`](https://url.spec.whatwg.org/#dom-urlsearchparams-delete) marked as [supported from Safari 17.0](https://developer.apple.com/documentation/safari-release-notes/safari-17-release-notes#Web-API)
    -   `value` argument of `URLSearchParams.prototype.{ has, delete }` marked as supported from [Deno 1.35](https://github.com/denoland/deno/pull/19654)
    -   `AggregateError` and well-formed `JSON.stringify` marked as [supported React Native 0.72 Hermes](https://reactnative.dev/blog/2023/06/21/0.72-metro-package-exports-symlinks#more-ecmascript-support-in-hermes)
    -   Added Deno 1.35 compat data mapping
    -   Added Quest Browser 28 compat data mapping
    -   Added missing NodeJS 12.16-12.22 compat data mapping
    -   Updated Opera Android 76 compat data mapping

### [`v3.31.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3310---20230612)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.30.2...v3.31.0)

-   [Well-formed unicode strings proposal](https://github.com/tc39/proposal-is-usv-string):
    -   Methods:
        -   `String.prototype.isWellFormed` method
        -   `String.prototype.toWellFormed` method
    -   Moved to stable ES, [May 2023 TC39 meeting](https://github.com/tc39/notes/blob/main/meetings/2023-05/may-15.md#well-formed-unicode-strings-for-stage-4)
    -   Added `es.` namespace modules, `/es/` and `/stable/` namespaces entries
-   [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping), [May 2023 TC39 meeting updates](https://github.com/tc39/notes/blob/main/meetings/2023-05/may-16.md#arrayprototypegroup-rename-for-web-compatibility):
    -   Because of the [web compat issue](https://github.com/tc39/proposal-array-grouping/issues/44), [moved from prototype to static methods](https://github.com/tc39/proposal-array-grouping/pull/47). Added:
        -   `Object.groupBy` method
        -   `Map.groupBy` method (with the actual semantic - with a minor difference it was present [in the collections methods stage 1 proposal](https://github.com/tc39/proposal-collection-methods))
    -   Demoted to stage 2
-   [Decorator Metadata proposal](https://github.com/tc39/proposal-decorator-metadata), [May 2023 TC39 meeting updates](https://github.com/tc39/notes/blob/main/meetings/2023-05/may-16.md#decorator-metadata-for-stage-3):
    -   Moved to stage 3
    -   Added `Function.prototype[Symbol.metadata]` (`=== null`)
    -   Added `/actual/` entries
-   [Iterator Helpers stage 3 proposal](https://github.com/tc39/proposal-iterator-helpers):
    -   Changed `Symbol.iterator` fallback from callable check to `undefined` / `null` check, [May 2023 TC39 meeting](https://github.com/tc39/notes/blob/main/meetings/2023-05/may-16.md#iterator-helpers-should-symboliterator-fallback-be-a-callable-check-or-an-undefinednull-check), [proposal-iterator-helpers/272](https://github.com/tc39/proposal-iterator-helpers/pull/272)
    -   Removed `IsCallable` check on `NextMethod`, deferring errors to `Call` site, [May 2023 TC39 meeting](https://github.com/tc39/notes/blob/main/meetings/2023-05/may-16.md#iterator-helpers-should-malformed-iterators-fail-early-or-fail-only-when-iterated), [proposal-iterator-helpers/274](https://github.com/tc39/proposal-iterator-helpers/pull/274)
-   Added [`Promise.withResolvers` stage 2 proposal](https://github.com/tc39/proposal-promise-with-resolvers):
    -   `Promise.withResolvers` method
-   [`Symbol` predicates stage 2 proposal](https://github.com/tc39/proposal-symbol-predicates):
    -   The methods renamed to end with `Symbol`, [May 2023 TC39 meeting](https://github.com/tc39/notes/blob/main/meetings/2023-05/may-15.md#symbol-predicates):
        -   `Symbol.isRegistered` -> `Symbol.isRegisteredSymbol` method
        -   `Symbol.isWellKnown` -> `Symbol.isWellKnownSymbol` method
-   Added `value` argument of `URLSearchParams.prototype.{ has, delete }`, [url/735](https://github.com/whatwg/url/pull/735)
-   Fixed some cases of increasing buffer size in `ArrayBuffer.prototype.{ transfer, transferToFixedLength }` polyfills
-   Fixed awaiting async `AsyncDisposableStack.prototype.adopt` callback, [#&#8203;1258](https://github.com/zloirock/core-js/issues/1258)
-   Fixed `URLSearchParams#size` in ES3 engines (IE8-)
-   Added a workaround in `Object.{ entries, values }` for some IE versions bug with invisible integer keys on `null`-prototype objects
-   Added TypeScript definitions to `core-js-compat`, [#&#8203;1235](https://github.com/zloirock/core-js/issues/1235), thanks [**@&#8203;susnux**](https://github.com/susnux)
-   Compat data improvements:
    -   [`Set.prototype.difference`](https://github.com/tc39/proposal-set-methods) that was missed in Bun because of [a bug](https://github.com/oven-sh/bun/issues/2309) added in 0.6.0
    -   `Array.prototype.{ group, groupToMap }` marked as no longer supported in WebKit runtimes because of the mentioned above web compat issue. For example, it's disabled from Bun 0.6.2
    -   Methods from the [change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) marked as supported from FF115
    -   [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async) marked as supported from FF115
    -   [`URL.canParse`](https://url.spec.whatwg.org/#dom-url-canparse) marked as supported from FF115
    -   `value` argument of `URLSearchParams.prototype.{ has, delete }` marked as supported from [NodeJS 20.2.0](https://github.com/nodejs/node/pull/47885) and FF115
    -   Added Deno 1.34 compat data mapping
    -   Added Electron 26 compat data mapping
    -   Added Samsung Internet 22 compat data mapping
    -   Added Opera Android 75 and 76 compat data mapping
    -   Added Quest Browser 27 compat data mapping

### [`v3.30.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3302---20230507)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.30.1...v3.30.2)

-   Added a fix for a NodeJS 20.0.0 [bug](https://github.com/nodejs/node/issues/47612) with cloning `File` via `structuredClone`
-   Added protection from Terser unsafe `String` optimization, [#&#8203;1242](https://github.com/zloirock/core-js/issues/1242)
-   Added a workaround for getting proper global object in Figma plugins, [#&#8203;1231](https://github.com/zloirock/core-js/issues/1231)
-   Compat data improvements:
    -   Added NodeJS 20.0 compat data mapping
    -   Added Deno 1.33 compat data mapping
    -   [`URL.canParse`](https://url.spec.whatwg.org/#dom-url-canparse) marked as supported (fixed) from [NodeJS 20.1.0](https://github.com/nodejs/node/pull/47513) and [Deno 1.33.2](https://github.com/denoland/deno/pull/18896)

### [`v3.30.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3301---20230414)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.30.0...v3.30.1)

-   Added a fix for a NodeJS 19.9.0 `URL.canParse` [bug](https://github.com/nodejs/node/issues/47505)
-   Compat data improvements:
    -   [`JSON.parse` source text access proposal](https://github.com/tc39/proposal-json-parse-with-source) features marked as [supported](https://chromestatus.com/feature/5121582673428480) from V8 ~ Chrome 114
    -   [`ArrayBuffer.prototype.transfer` and friends proposal](https://github.com/tc39/proposal-arraybuffer-transfer) features marked as [supported](https://chromestatus.com/feature/5073244152922112) from V8 ~ Chrome 114
    -   [`URLSearchParams.prototype.size`](https://github.com/whatwg/url/pull/734) marked as supported from V8 ~ Chrome 113

### [`v3.30.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3300---20230404)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.29.1...v3.30.0)

-   Added [`URL.canParse` method](https://url.spec.whatwg.org/#dom-url-canparse), [url/763](https://github.com/whatwg/url/pull/763)
-   [`Set` methods proposal](https://github.com/tc39/proposal-set-methods):
    -   Removed sort from `Set.prototype.intersection`, [March 2023 TC39 meeting](https://github.com/babel/proposals/issues/87#issuecomment-1478610425), [proposal-set-methods/94](https://github.com/tc39/proposal-set-methods/pull/94)
-   Iterator Helpers proposals ([sync](https://github.com/tc39/proposal-iterator-helpers), [async](https://github.com/tc39/proposal-async-iterator-helpers)):
    -   Validate arguments before opening iterator, [March 2023 TC39 meeting](https://github.com/babel/proposals/issues/87#issuecomment-1478412430), [proposal-iterator-helpers/265](https://github.com/tc39/proposal-iterator-helpers/pull/265)
-   Explicit Resource Management proposals ([sync](https://github.com/tc39/proposal-explicit-resource-management), [async](https://github.com/tc39/proposal-async-explicit-resource-management)):
    -   `(Async)DisposableStack.prototype.move` marks the original stack as disposed, [#&#8203;1226](https://github.com/zloirock/core-js/issues/1226)
    -   Some simplifications like [proposal-explicit-resource-management/150](https://github.com/tc39/proposal-explicit-resource-management/pull/150)
-   [`Iterator.range` proposal](https://github.com/tc39/proposal-Number.range):
    -   Moved to Stage 2, [March 2023 TC39 meeting](https://github.com/babel/proposals/issues/87#issuecomment-1480266760)
-   [Decorator Metadata proposal](https://github.com/tc39/proposal-decorator-metadata):
    -   Returned to usage `Symbol.metadata`, [March 2023 TC39 meeting](https://github.com/babel/proposals/issues/87#issuecomment-1478790137), [proposal-decorator-metadata/12](https://github.com/tc39/proposal-decorator-metadata/pull/12)
-   Compat data improvements:
    -   [`URLSearchParams.prototype.size`](https://github.com/whatwg/url/pull/734) marked as supported from FF112, NodeJS 19.8 and Deno 1.32
    -   Added Safari 16.4 compat data
    -   Added Deno 1.32 compat data mapping
    -   Added Electron 25 and updated 24 compat data mapping
    -   Added Samsung Internet 21 compat data mapping
    -   Added Quest Browser 26 compat data mapping
    -   Updated Opera Android 74 compat data

### [`v3.29.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3291---20230313)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.29.0...v3.29.1)

-   Fixed dependencies of some entries
-   Fixed `ToString` conversion / built-ins nature of some accessors
-   [`String.prototype.{ isWellFormed, toWellFormed }`](https://github.com/tc39/proposal-is-usv-string) marked as supported from V8 ~ Chrome 111
-   Added Opera Android 74 compat data mapping

### [`v3.29.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3290---20230227)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.28.0...v3.29.0)

-   Added `URLSearchParams.prototype.size` getter, [url/734](https://github.com/whatwg/url/pull/734)
-   Allowed cloning resizable `ArrayBuffer`s in the `structuredClone` polyfill
-   Fixed wrong export in `/(stable|actual|full)/instance/unshift` entries, [#&#8203;1207](https://github.com/zloirock/core-js/issues/1207)
-   Compat data improvements:
    -   [`Set` methods proposal](https://github.com/tc39/proposal-set-methods) marked as supported from Bun 0.5.7
    -   `String.prototype.toWellFormed` marked as fixed from Bun 0.5.7
    -   Added Deno 1.31 compat data mapping

### [`v3.28.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3280---20230214)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.27.2...v3.28.0)

##### [3.28.0 - 2023.02.14](https://github.com/zloirock/core-js/releases/tag/v3.28.0)

### [`v3.27.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3272---20230119)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.27.1...v3.27.2)

-   [`Set` methods proposal](https://github.com/tc39/proposal-set-methods) updates:
    -   Closing of iterators of `Set`-like objects on early exit, [proposal-set-methods/85](https://github.com/tc39/proposal-set-methods/pull/85)
    -   Some other minor internal changes
-   Added one more workaround of a `webpack` dev server bug on IE global methods, [#&#8203;1161](https://github.com/zloirock/core-js/issues/1161)
-   Fixed possible `String.{ raw, cooked }` error with empty template array
-   Used non-standard V8 `Error.captureStackTrace` instead of stack parsing in new error classes / wrappers where it's possible
-   Added detection correctness of iteration to `Promise.{ allSettled, any }` feature detection, Hermes issue
-   Compat data improvements:
    -   [Change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) marked as supported from V8 ~ Chrome 110
    -   Added Samsung Internet 20 compat data mapping
    -   Added Quest Browser 25 compat data mapping
    -   Added React Native 0.71 Hermes compat data
    -   Added Electron 23 and 24 compat data mapping
    -   `self` marked as fixed in Deno 1.29.3, [deno/17362](https://github.com/denoland/deno/pull/17362)
-   Minor tweaks of minification settings for `core-js-bundle`
-   Refactoring, some minor fixes, improvements, optimizations

### [`v3.27.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3271---20221230)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.27.0...v3.27.1)

-   Fixed a Chakra-based MS Edge (18-) bug that unfreeze (O_o) frozen arrays used as `WeakMap` keys
-   Fixing of the previous bug also fixes some cases of `String.dedent` in MS Edge
-   Fixed dependencies of some entries

### [`v3.27.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3270---20221226)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.26.1...v3.27.0)

-   [Iterator Helpers](https://github.com/tc39/proposal-iterator-helpers) proposal:
    -   Built-ins:
        -   `Iterator`
            -   `Iterator.from`
            -   `Iterator.prototype.drop`
            -   `Iterator.prototype.every`
            -   `Iterator.prototype.filter`
            -   `Iterator.prototype.find`
            -   `Iterator.prototype.flatMap`
            -   `Iterator.prototype.forEach`
            -   `Iterator.prototype.map`
            -   `Iterator.prototype.reduce`
            -   `Iterator.prototype.some`
            -   `Iterator.prototype.take`
            -   `Iterator.prototype.toArray`
            -   `Iterator.prototype.toAsync`
            -   `Iterator.prototype[@&#8203;@&#8203;toStringTag]`
        -   `AsyncIterator`
            -   `AsyncIterator.from`
            -   `AsyncIterator.prototype.drop`
            -   `AsyncIterator.prototype.every`
            -   `AsyncIterator.prototype.filter`
            -   `AsyncIterator.prototype.find`
            -   `AsyncIterator.prototype.flatMap`
            -   `AsyncIterator.prototype.forEach`
            -   `AsyncIterator.prototype.map`
            -   `AsyncIterator.prototype.reduce`
            -   `AsyncIterator.prototype.some`
            -   `AsyncIterator.prototype.take`
            -   `AsyncIterator.prototype.toArray`
            -   `AsyncIterator.prototype[@&#8203;@&#8203;toStringTag]`
    -   Moved to Stage 3, [November 2022 TC39 meeting](https://github.com/babel/proposals/issues/85#issuecomment-1333474304)
    -   Added `/actual/` entries, unconditional forced replacement disabled for features that survived to Stage 3
    -   `.from` accept strings, `.flatMap` throws on strings returned from the callback, [proposal-iterator-helpers/244](https://github.com/tc39/proposal-iterator-helpers/pull/244), [proposal-iterator-helpers/250](https://github.com/tc39/proposal-iterator-helpers/pull/250)
    -   `.from` and `.flatMap` throws on non-object *iterators*, [proposal-iterator-helpers/253](https://github.com/tc39/proposal-iterator-helpers/pull/253)
-   [`Set` methods proposal](https://github.com/tc39/proposal-set-methods):
    -   Built-ins:
        -   `Set.prototype.intersection`
        -   `Set.prototype.union`
        -   `Set.prototype.difference`
        -   `Set.prototype.symmetricDifference`
        -   `Set.prototype.isSubsetOf`
        -   `Set.prototype.isSupersetOf`
        -   `Set.prototype.isDisjointFrom`
    -   Moved to Stage 3, [November 2022 TC39 meeting](https://github.com/babel/proposals/issues/85#issuecomment-1332175557)
    -   Reimplemented with [new semantics](https://tc39.es/proposal-set-methods/):
        -   Optimized performance (iteration over lowest set)
        -   Accepted only `Set`-like objects as an argument, not all iterables
        -   Accepted only `Set`s as `this`, no `@@&#8203;species` support, and other minor changes
    -   Added `/actual/` entries, unconditional forced replacement changed to feature detection
    -   For avoiding breaking changes:
        -   New versions of methods are implemented as new modules and available in new entries or entries where old versions of methods were not available before (like `/actual/` namespace)
        -   In entries where they were available before (like `/full/` namespace), those methods are available with fallbacks to old semantics (in addition to `Set`-like, they accept iterable objects). This behavior will be removed from the next major release
-   [Well-Formed Unicode Strings](https://github.com/tc39/proposal-is-usv-string) proposal:
    -   Methods:
        -   `String.prototype.isWellFormed`
        -   `String.prototype.toWellFormed`
    -   Moved to Stage 3, [November 2022 TC39 meeting](https://github.com/babel/proposals/issues/85#issuecomment-1332180862)
    -   Added `/actual/` entries, disabled unconditional forced replacement
-   [Explicit resource management](https://github.com/tc39/proposal-explicit-resource-management) Stage 3 and [Async explicit resource management](https://github.com/tc39/proposal-async-explicit-resource-management) Stage 2 proposals:
    -   Renamed from "`using` statement" and [split into 2 (sync and async) proposals](https://github.com/tc39/proposal-explicit-resource-management/pull/131)
    -   In addition to already present well-known symbols, added new built-ins:
        -   `Symbol.dispose`
        -   `Symbol.asyncDispose`
        -   `SuppressedError`
        -   `DisposableStack`
            -   `DisposableStack.prototype.dispose`
            -   `DisposableStack.prototype.use`
            -   `DisposableStack.prototype.adopt`
            -   `DisposableStack.prototype.defer`
            -   `DisposableStack.prototype.move`
            -   `DisposableStack.prototype[@&#8203;@&#8203;dispose]`
        -   `AsyncDisposableStack`
            -   `AsyncDisposableStack.prototype.disposeAsync`
            -   `AsyncDisposableStack.prototype.use`
            -   `AsyncDisposableStack.prototype.adopt`
            -   `AsyncDisposableStack.prototype.defer`
            -   `AsyncDisposableStack.prototype.move`
            -   `AsyncDisposableStack.prototype[@&#8203;@&#8203;asyncDispose]`
        -   `Iterator.prototype[@&#8203;@&#8203;dispose]`
        -   `AsyncIterator.prototype[@&#8203;@&#8203;asyncDispose]`
    -   Sync version of this proposal moved to Stage 3, [November 2022 TC39 meeting](https://github.com/babel/proposals/issues/85#issuecomment-1333747094)
    -   Added `/actual/` namespace entries for Stage 3 proposal
-   Added [`String.dedent` stage 2 proposal](https://github.com/tc39/proposal-string-dedent)
    -   Method `String.dedent`
    -   Throws an error on non-frozen raw templates for avoiding possible breaking changes in the future, [proposal-string-dedent/75](https://github.com/tc39/proposal-string-dedent/issues/75)
-   [Compat data targets](/packages/core-js-compat#targets-option) improvements:
    -   [React Native from 0.70 shipped with Hermes as the default engine.](https://reactnative.dev/blog/2022/07/08/hermes-as-the-default) However, bundled Hermes versions differ from standalone Hermes releases. So added **`react-native`** target for React Native with bundled Hermes.
    -   [According to the documentation](https://developer.oculus.com/documentation/web/browser-intro/), Oculus Browser was renamed to Meta Quest Browser, so `oculus` target was renamed to **`quest`**.
    -   `opera_mobile` target name is confusing since it contains data for the Chromium-based Android version, but iOS Opera is Safari-based. So `opera_mobile` target was renamed to **`opera-android`**.
    -   `android` target name is also confusing for someone - that means Android WebView, some think thinks that it's Chrome for Android, but they have some differences. For avoiding confusion, added **`chrome-android`** target.
    -   For consistency with two previous cases, added **`firefox-android`** target.
    -   For avoiding breaking changes, the `oculus` and `opera_mobile` fields are available in the compat data till the next major release.
-   Compat data improvements:
    -   [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async) marked as supported from Bun 0.3.0
    -   [`String.prototype.{ isWellFormed, toWellFormed }`](https://github.com/tc39/proposal-is-usv-string) marked as supported from Bun 0.4.0
    -   [Change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) marked as supported from Deno 1.27, [deno/16429](https://github.com/denoland/deno/pull/16429)
    -   Added Deno 1.28 / 1.29 compat data mapping
    -   Added NodeJS 19.2 compat data mapping
    -   Added Samsung Internet 19.0 compat data mapping
    -   Added Quest Browser 24.0 compat data mapping
    -   Fixed the first version in the Chromium-based Edge compat data mapping
-   `{ Map, WeakMap }.prototype.emplace` became stricter [by the spec draft](https://tc39.es/proposal-upsert/)
-   Smoothed behavior of some conflicting proposals
-   Removed some generic behavior (like `@@&#8203;species` pattern) of some `.prototype` methods from the [new collections methods proposal](https://github.com/tc39/proposal-collection-methods) and the [`Array` deduplication proposal](https://github.com/tc39/proposal-array-unique) that *most likely* will not be implemented since it contradicts the current TC39 policy
-   Added pure version of the `Number` constructor, [#&#8203;1154](https://github.com/zloirock/core-js/issues/1154), [#&#8203;1155](https://github.com/zloirock/core-js/issues/1155), thanks [@&#8203;trosos](https://github.com/trosos)
-   Added `set(Timeout|Interval|Immediate)` extra arguments fix for Bun 0.3.0- (similarly to IE9-), [bun/1633](https://github.com/oven-sh/bun/issues/1633)
-   Fixed handling of sparse arrays in `structuredClone`, [#&#8203;1156](https://github.com/zloirock/core-js/issues/1156)
-   Fixed a theoretically possible future conflict of polyfills definitions in the pure version
-   Some refactoring and optimization

### [`v3.26.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3261---20221114)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.26.0...v3.26.1)

-   Disabled forced replacing of `Array.fromAsync` since it's on Stage 3
-   Avoiding a check of the target in the internal `function-uncurry-this` helper where it's not required - minor optimization and preventing problems in some broken environments, a workaround of [#&#8203;1141](https://github.com/zloirock/core-js/issues/1141)
-   V8 will not ship `Array.prototype.{ group, groupToMap }` in V8 ~ Chromium 108, [proposal-array-grouping/44](https://github.com/tc39/proposal-array-grouping/issues/44#issuecomment-1306311107)

### [`v3.26.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3260---20221024)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.25.5...v3.26.0)

-   [`Array.fromAsync` proposal](https://github.com/tc39/proposal-array-from-async):
    -   Moved to Stage 3, [September TC39 meeting](https://github.com/tc39/notes/blob/main/meetings/2022-09/sep-14.md#arrayfromasync-for-stage-3)
    -   Avoid observable side effects of `%Array.prototype.values%` usage in array-like branch, [proposal-array-from-async/30](https://github.com/tc39/proposal-array-from-async/pull/30)
-   Added [well-formed unicode strings stage 2 proposal](https://github.com/tc39/proposal-is-usv-string):
    -   `String.prototype.isWellFormed`
    -   `String.prototype.toWellFormed`
-   Recent updates of the [iterator helpers proposal](https://github.com/tc39/proposal-iterator-helpers):
    -   Added a counter parameter to helpers, [proposal-iterator-helpers/211](https://github.com/tc39/proposal-iterator-helpers/pull/211)
    -   Don't await non-objects returned from functions passed to `AsyncIterator` helpers, [proposal-iterator-helpers/239](https://github.com/tc39/proposal-iterator-helpers/pull/239)
    -   `{ Iterator, AsyncIterator }.prototype.flatMap` supports returning both - iterables and iterators, [proposal-iterator-helpers/233](https://github.com/tc39/proposal-iterator-helpers/pull/233)
    -   Early exit on broken `.next` in missed cases of `{ Iterator, AsyncIterator }.from`, [proposal-iterator-helpers/232](https://github.com/tc39/proposal-iterator-helpers/pull/232)
-   Added `self` polyfill as a part of [The Minimum Common Web Platform API](https://common-min-api.proposal.wintercg.org/), [specification](https://html.spec.whatwg.org/multipage/window-object.html#dom-self), [#&#8203;1118](https://github.com/zloirock/core-js/issues/1118)
-   Added `inverse` option to `core-js-compat`, [#&#8203;1119](https://github.com/zloirock/core-js/issues/1119)
-   Added `format` option to `core-js-builder`, [#&#8203;1120](https://github.com/zloirock/core-js/issues/1120)
-   Added NodeJS 19.0 compat data
-   Added Deno 1.26 and 1.27 compat data
-   Added Opera Android 72 compat data mapping
-   Updated Electron 22 compat data mapping

### [`v3.25.5`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3255---20221004)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.25.4...v3.25.5)

-   Fixed regression with an error on reuse of some built-in methods from another realm, [#&#8203;1133](https://github.com/zloirock/core-js/issues/1133)

### [`v3.25.4`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3254---20221003)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.25.3...v3.25.4)

-   Added a workaround of a Nashorn bug with `Function.prototype.{ call, apply, bind }` on string methods, [#&#8203;1128](https://github.com/zloirock/core-js/issues/1128)
-   Updated lists of `[Serializable]` and `[Transferable]` objects in the `structuredClone` polyfill. Mainly, for better error messages if polyfilling of cloning such types is impossible
-   `Array.prototype.{ group, groupToMap }` marked as [supported from V8 ~ Chromium 108](https://chromestatus.com/feature/5714791975878656)
-   Added Electron 22 compat data mapping

### [`v3.25.3`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3253---20220926)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.25.2...v3.25.3)

-   Forced polyfilling of `Array.prototype.groupToMap` in the pure version for returning wrapped `Map` instances
-   Fixed existence of `Array.prototype.{ findLast, findLastIndex }` in `/stage/4` entry
-   Added Opera Android 71 compat data mapping
-   Some stylistic changes

### [`v3.25.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3252---20220919)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.25.1...v3.25.2)

-   Considering `document.all` as a callable in some missed cases
-   Added Safari 16.0 compat data
-   Added iOS Safari 16.0 compat data mapping
-   Fixed some ancient iOS Safari versions compat data mapping

### [`v3.25.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3251---20220908)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.25.0...v3.25.1)

-   Added some fixes and workarounds of FF30- typed arrays bug that does not properly convert objects to numbers
-   Added `sideEffects` field to `core-js-pure` `package.json` for better tree shaking, [#&#8203;1117](https://github.com/zloirock/core-js/issues/1117)
-   Dropped `semver` dependency from `core-js-compat`
    -   `semver` package (ironically) added [a breaking change and dropped NodeJS 8 support in the minor `7.1` version](https://github.com/npm/node-semver/commit/d61f828e64260a0a097f26210f5500), after that `semver` in `core-js-compat` was pinned to `7.0` since for avoiding breaking changes it should support NodeJS 8. However, since `core-js-compat` is usually used with other packages that use `semver` dependency, it causes multiple duplication of `semver` in dependencies. So I decided to remove `semver` dependency and replace it with a couple of simple helpers.
-   Added Bun 0.1.6-0.1.11 compat data
-   Added Deno 1.25 compat data mapping
-   Updated Electron 21 compat data mapping
-   Some stylistic changes, minor fixes, and improvements

### [`v3.25.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3250---20220825)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.24.1...v3.25.0)

-   Added [`Object.prototype.__proto__`](https://tc39.es/ecma262/#sec-object.prototype.\__proto\_\_) polyfill
    -   It's optional, legacy, and in some cases (mainly because of developers' mistakes) can cause problems, but [some libraries depend on it](https://github.com/denoland/deno/issues/13321), and most code can't work without the proper libraries' ecosystem
    -   Only for modern engines where this feature is missed (like Deno), it's not installed in IE10- since here we have no proper way setting of the prototype
    -   Without fixes of early implementations where it's not an accessor since those fixes are impossible
    -   Only for the global version
-   Considering `document.all` as an object in some missed cases, see [ECMAScript Annex B 3.6](https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot)
-   Avoiding unnecessary promise creation and validation result in `%WrapForValid(Async)IteratorPrototype%.return`, [proposal-iterator-helpers/215](https://github.com/tc39/proposal-iterator-helpers/pull/215)
-   Fixed omitting the result of proxing `.return` in `%IteratorHelperPrototype%.return`, [#&#8203;1116](https://github.com/zloirock/core-js/issues/1116)
-   Fixed the order creation of properties of iteration result object of some iterators (`value` should be created before `done`)
-   Fixed some cases of Safari < 13 bug - silent on non-writable array `.length` setting
-   Fixed `ArrayBuffer.length` in V8 ~ Chrome 27-
-   Relaxed condition of re-usage native `WeakMap` for internal states with multiple `core-js` copies
-   Availability cloning of `FileList` in the `structuredClone` polyfill extended to some more old engines versions
-   Some stylistic changes and minor fixes
-   Throwing a `TypeError` in `core-js-compat` / `core-js-builder` in case of passing invalid module names / filters for avoiding unexpected result, related to [#&#8203;1115](https://github.com/zloirock/core-js/issues/1115)
-   Added missed NodeJS 13.2 to `esmodules` `core-js-compat` / `core-js-builder` target
-   Added Electron 21 compat data mapping
-   Added Oculus Browser 23.0 compat data mapping

### [`v3.24.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3241---20220730)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.24.0...v3.24.1)

-   NodeJS is ignored in `IS_BROWSER` detection to avoid a false positive with `jsdom`, [#&#8203;1110](https://github.com/zloirock/core-js/issues/1110)
-   Fixed detection of `@@&#8203;species` support in `Promise` in some old engines
-   `{ Array, %TypedArray% }.prototype.{ findLast, findLastIndex }` marked as shipped [in FF104](https://bugzilla.mozilla.org/show_bug.cgi?id=1775026)
-   Added iOS Safari 15.6 compat data mapping
-   Fixed Opera 15 compat data mapping

### [`v3.24.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3240---20220725)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.23.5...v3.24.0)

-   Recent updates of the [iterator helpers proposal](https://github.com/tc39/proposal-iterator-helpers), [#&#8203;1101](https://github.com/zloirock/core-js/issues/1101):
    -   `.asIndexedPairs` renamed to `.indexed`, [proposal-iterator-helpers/183](https://github.com/tc39/proposal-iterator-helpers/pull/183):
        -   `Iterator.prototype.asIndexedPairs` -> `Iterator.prototype.indexed`
        -   `AsyncIterator.prototype.asIndexedPairs` -> `AsyncIterator.prototype.indexed`
    -   Avoid exposing spec fiction `%AsyncFromSyncIteratorPrototype%` in `AsyncIterator.from` and `Iterator.prototype.toAsync`, [proposal-iterator-helpers/182](https://github.com/tc39/proposal-iterator-helpers/pull/182), [proposal-iterator-helpers/202](https://github.com/tc39/proposal-iterator-helpers/pull/202)
    -   Avoid unnecessary promise creation in `%WrapForValidAsyncIteratorPrototype%.next`, [proposal-iterator-helpers/197](https://github.com/tc39/proposal-iterator-helpers/pull/197)
    -   Do not validate value in `%WrapForValid(Async)IteratorPrototype%.next`, [proposal-iterator-helpers/197](https://github.com/tc39/proposal-iterator-helpers/pull/197) and [proposal-iterator-helpers/205](https://github.com/tc39/proposal-iterator-helpers/pull/205)
    -   Do not forward the parameter of `.next` / `.return` to an underlying iterator by the extended iterator protocol, a part of [proposal-iterator-helpers/194](https://github.com/tc39/proposal-iterator-helpers/pull/194)
    -   `.throw` methods removed from all wrappers / helpers prototypes, a part of [proposal-iterator-helpers/194](https://github.com/tc39/proposal-iterator-helpers/pull/194)
    -   Close inner iterators of `{ Iterator, AsyncIterator }.prototype.flatMap` proxy iterators on `.return`, [proposal-iterator-helpers/195](https://github.com/tc39/proposal-iterator-helpers/pull/195)
    -   Throw `RangeError` on `NaN` in `{ Iterator, AsyncIterator }.prototype.{ drop, take }`, [proposal-iterator-helpers/181](https://github.com/tc39/proposal-iterator-helpers/pull/181)
    -   Many other updates and fixes of this proposal
-   `%TypedArray%.prototype.toSpliced` method removed from the [change array by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) and marked as obsolete in `core-js`, [proposal-change-array-by-copy/88](https://github.com/tc39/proposal-change-array-by-copy/issues/88)
-   Polyfill `Promise` with `unhandledrejection` event support (browser style) in Deno < [1.24](https://github.com/denoland/deno/releases/tag/v1.24.0)
-   Available new targets in `core-js-compat` / `core-js-builder` and added compat data for them:
    -   Bun (`bun`), compat data for 0.1.1-0.1.5, [#&#8203;1103](https://github.com/zloirock/core-js/issues/1103)
    -   Hermes (`hermes`), compat data for 0.1-0.11, [#&#8203;1099](https://github.com/zloirock/core-js/issues/1099)
    -   Oculus Browser (`oculus`), compat data mapping for 3.0-22.0, [#&#8203;1098](https://github.com/zloirock/core-js/issues/1098)
-   Added Samsung Internet 18.0 compat data mapping

### [`v3.23.5`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3235---20220718)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.23.4...v3.23.5)

-   Fixed a typo in the `structuredClone` feature detection, [#&#8203;1106](https://github.com/zloirock/core-js/issues/1106)
-   Added Opera Android 70 compat data mapping

### [`v3.23.4`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3234---20220710)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.23.3...v3.23.4)

-   Added a workaround of the Bun ~ 0.1.1 [bug](https://github.com/Jarred-Sumner/bun/issues/399) that define some globals with incorrect property descriptors and that causes a crash of `core-js`
-   Added a fix of the FF103+ `structuredClone` bugs ([1774866](https://bugzilla.mozilla.org/show_bug.cgi?id=1774866) (fixed in FF104) and [1777321](https://bugzilla.mozilla.org/show_bug.cgi?id=1777321) (still not fixed)) that now can clone errors, but `.stack` of the clone is an empty string
-   Fixed `{ Map, WeakMap }.prototype.emplace` logic, [#&#8203;1102](https://github.com/zloirock/core-js/issues/1102)
-   Fixed order of errors throwing on iterator helpers

### [`v3.23.3`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3233---20220626)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.23.2...v3.23.3)

-   Changed the order of operations in `%TypedArray%.prototype.toSpliced` following [proposal-change-array-by-copy/89](https://github.com/tc39/proposal-change-array-by-copy/issues/89)
-   Fixed regression of some IE8- issues

### [`v3.23.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3232---20220621)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.23.1...v3.23.2)

-   Avoided creation of extra properties for the handling of `%TypedArray%` constructors in new methods, [#&#8203;1092 (comment)](https://github.com/zloirock/core-js/issues/1092#issuecomment-1158760512)
-   Added Deno 1.23 compat data mapping

### [`v3.23.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3231---20220614)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.23.0...v3.23.1)

-   Fixed possible error on multiple `core-js` copies, [#&#8203;1091](https://github.com/zloirock/core-js/issues/1091)
-   Added `v` flag to `RegExp.prototype.flags` implementation in case if current V8 bugs will not be fixed before this flag implementation

### [`v3.23.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3230---20220614)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.8...v3.23.0)

-   [`Array` find from last](https://github.com/tc39/proposal-array-find-from-last) moved to the stable ES, according to June 2022 TC39 meeting:
    -   `Array.prototype.findLast`
    -   `Array.prototype.findLastIndex`
    -   `%TypedArray%.prototype.findLast`
    -   `%TypedArray%.prototype.findLastIndex`
-   Methods from [the `Array` grouping proposal](https://github.com/tc39/proposal-array-grouping) [renamed](https://github.com/tc39/proposal-array-grouping/pull/39), according to June 2022 TC39 meeting:
    -   `Array.prototype.groupBy` -> `Array.prototype.group`
    -   `Array.prototype.groupByToMap` -> `Array.prototype.groupToMap`
-   Changed the order of operations in `%TypedArray%.prototype.with` following [proposal-change-array-by-copy/86](https://github.com/tc39/proposal-change-array-by-copy/issues/86), according to June 2022 TC39 meeting
-   [Decorator Metadata proposal](https://github.com/tc39/proposal-decorator-metadata) extracted from [Decorators proposal](https://github.com/tc39/proposal-decorators) as a separate stage 2 proposal, according to March 2022 TC39 meeting, `Symbol.metadataKey` replaces `Symbol.metadata`
-   Added `Array.prototype.push` polyfill with some fixes for modern engines
-   Added `Array.prototype.unshift` polyfill with some fixes for modern engines
-   Fixed a bug in the order of getting flags in `RegExp.prototype.flags` in the actual version of V8
-   Fixed property descriptors of some `Math` and `Number` constants
-   Added a workaround of V8 `ArrayBufferDetaching` protector cell invalidation and performance degradation on `structuredClone` feature detection, one more case of [#&#8203;679](https://github.com/zloirock/core-js/issues/679)
-   Added detection of NodeJS [bug](https://github.com/nodejs/node/issues/41038) in `structuredClone` that can not clone `DOMException` (just in case for future versions that will fix other issues)
-   Compat data:
    -   Added NodeJS 18.3 compat data mapping
    -   Added and fixed Deno 1.22 and 1.21 compat data mapping
    -   Added Opera Android 69 compat data mapping
    -   Updated Electron 20.0 compat data mapping

### [`v3.22.8`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3228---20220602)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.7...v3.22.8)

-   Fixed possible multiple call of `ToBigInt` / `ToNumber` conversion of the argument passed to `%TypedArray%.prototype.fill` in V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18
-   Fixed some cases of `DeletePropertyOrThrow` in IE9-
-   Fixed the kind of error (`TypeError` instead of `Error`) on incorrect `exec` result in `RegExp.prototype.test` polyfill
-   Fixed dependencies of `{ actual, full, features }/typed-array/at` entries
-   Added Electron 20.0 compat data mapping
-   Added iOS Safari 15.5 compat data mapping
-   Refactoring

### [`v3.22.7`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3227---20220524)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.6...v3.22.7)

-   Added a workaround for V8 ~ Chrome 53 bug with non-writable prototype of some methods, [#&#8203;1083](https://github.com/zloirock/core-js/issues/1083)

### [`v3.22.6`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3226---20220523)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.5...v3.22.6)

-   Fixed possible double call of `ToNumber` conversion on arguments of `Math.{ fround, trunc }` polyfills
-   `Array.prototype.includes` marked as [fixed](https://bugzilla.mozilla.org/show_bug.cgi?id=1767541) in FF102

### [`v3.22.5`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3225---20220510)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.4...v3.22.5)

-   Ensured that polyfilled constructors `.prototype` is non-writable
-   Ensured that polyfilled methods `.prototype` is not defined
-   Added detection and fix of a V8 ~ Chrome <103 [bug](https://bugs.chromium.org/p/v8/issues/detail?id=12542) of `struturedClone` that returns `null` if cloned object contains multiple references to one error

### [`v3.22.4`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3224---20220503)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.3...v3.22.4)

-   Ensured proper `.length` of polyfilled functions even in compressed code (excepting some ancient engines)
-   Ensured proper `.name` of polyfilled accessors (excepting some ancient engines)
-   Ensured proper source / `ToString` conversion of polyfilled accessors
-   Actualized Rhino compat data
-   Refactoring

### [`v3.22.3`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3223---20220428)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.2...v3.22.3)

-   Added a fix for FF99+ `Array.prototype.includes` broken on sparse arrays

### [`v3.22.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3222---20220421)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.1...v3.22.2)

-   Fixed `URLSearchParams` in IE8- that was broken in the previous release
-   Fixed `__lookupGetter__` entries

### [`v3.22.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3221---20220420)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.22.0...v3.22.1)

-   Improved some cases of `RegExp` flags handling
-   Prevented experimental warning in NodeJS ~ 18.0 on detection `fetch` API
-   Added NodeJS 18.0 compat data

### [`v3.22.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3220---20220415)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.21.1...v3.22.0)

-   [Change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy):
    -   Moved to Stage 3, [March TC39 meeting](https://github.com/babel/proposals/issues/81#issuecomment-1083449843)
    -   Disabled forced replacement and added `/actual/` entry points for methods from this proposal
    -   `Array.prototype.toSpliced` throws a `TypeError` instead of `RangeError` if the result length is more than `MAX_SAFE_INTEGER`, [proposal-change-array-by-copy/70](https://github.com/tc39/proposal-change-array-by-copy/pull/70)
-   Added some more `atob` / `btoa` fixes:
    -   NodeJS <17.9 `atob` does not ignore spaces, [node/42530](https://github.com/nodejs/node/issues/42530)
    -   Actual NodeJS `atob` does not validate encoding, [node/42646](https://github.com/nodejs/node/issues/42646)
    -   FF26- implementation does not properly convert argument to string
    -   IE / Edge <16 implementation have wrong arity
-   Added `/full/` namespace as the replacement for `/features/` since it's more descriptive in context of the rest namespaces (`/es/` ⊆ `/stable/` ⊆ `/actual/` ⊆ `/full/`)
-   Avoided propagation of removed parts of proposals to upper stages. For example, `%TypedArray%.prototype.groupBy` was removed from the `Array` grouping proposal a long time ago. We can't completely remove this method since it's a breaking change. But this proposal has been promoted to stage 3 - so the proposal should be promoted without this method, this method should not be available in `/actual/` entries - but it should be available in early-stage entries to avoid breakage.
-   Significant internal refactoring and splitting of modules (but without exposing to public API since it will be a breaking change - it will be exposed in the next major version)
-   Bug fixes:
    -   Fixed work of non-standard V8 `Error` features with wrapped `Error` constructors, [#&#8203;1061](https://github.com/zloirock/core-js/issues/1061)
    -   `null` and `undefined` allowed as the second argument of `structuredClone`, [#&#8203;1056](https://github.com/zloirock/core-js/issues/1056)
-   Tooling:
    -   Stabilized proposals are filtered out from the `core-js-compat` -> `core-js-builder` -> `core-js-bundle` output. That mean that if the output contains, for example, `es.object.has-own`, the legacy reference to it, `esnext.object.has-own`, no longer added.
    -   Aligned modules filters of [`core-js-builder`](https://github.com/zloirock/core-js/tree/master/packages/core-js-builder) and [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat), now it's `modules` and `exclude` options
    -   Added support of entry points, modules, regexes, and arrays of them to those filters
    -   Missed `targets` option of `core-js-compat` means that the `targets` filter just will not be applied, so the result will contain modules required for all possible engines
-   Compat data:
    -   `.stack` property on `DOMException` marked as supported from Deno [1.15](https://github.com/denoland/deno/releases/tag/v1.15.0)
    -   Added Deno 1.21 compat data mapping
    -   Added Electron 19.0 and updated 18.0 compat data mapping
    -   Added Samsung Internet 17.0 compat data mapping
    -   Added Opera Android 68 compat data mapping

### [`v3.21.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3211---20220217)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.21.0...v3.21.1)

-   Added a [bug](https://bugs.webkit.org/show_bug.cgi?id=236541)fix for the WebKit `Array.prototype.{ groupBy, groupByToMap }` implementation
-   `core-js-compat` targets parser transforms engine names to lower case
-   `atob` / `btoa` marked as [fixed](https://github.com/nodejs/node/pull/41478) in NodeJS 17.5
-   Added Electron 18.0 compat data mapping
-   Added Deno 1.20 compat data mapping

### [`v3.21.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3210---20220202)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.20.3...v3.21.0)

-   Added [Base64 utility methods](https://developer.mozilla.org/en-US/docs/Glossary/Base64):
    -   `atob`
    -   `btoa`
-   Added the proper validation of arguments to some methods from web standards
-   Forced replacement of all features from early-stage proposals for avoiding possible web compatibility issues in the future
-   Added Rhino 1.7.14 compat data
-   Added Deno 1.19 compat data mapping
-   Added Opera Android 66 and 67 compat data mapping
-   Added iOS Safari 15.3 and 15.4 compat data mapping

### [`v3.20.3`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3203---20220115)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.20.2...v3.20.3)

-   Detects and replaces broken third-party `Function#bind` polyfills, uses only native `Function#bind` in the internals
-   `structuredClone` should throw an error if no arguments passed
-   Changed the structure of notes in `__core-js_shared__`

### [`v3.20.2`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3202---20220102)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.20.1...v3.20.2)

-   Added a fix of [a V8 ~ Chrome 36- `Object.{ defineProperty, defineProperties }` bug](https://bugs.chromium.org/p/v8/issues/detail?id=3334), [Babel issue](https://github.com/babel/babel/issues/14056)
-   Added fixes of some different `%TypedArray%.prototype.set` bugs, affects modern engines (like Chrome < 95 or Safari < 14.1)

### [`v3.20.1`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3201---20211223)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.20.0...v3.20.1)

-   Fixed the order of calling reactions of already fulfilled / rejected promises in `Promise.prototype.then`, [#&#8203;1026](https://github.com/zloirock/core-js/issues/1026)
-   Fixed possible memory leak in specific promise chains
-   Fixed some missed dependencies of entries
-   Added Deno 1.18 compat data mapping

### [`v3.20.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3200---20211216)

[Compare Source](https://github.com/zloirock/core-js/compare/v3.19.3...v3.20.0)

-   Added `structuredClone` method [from the HTML spec](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone), [see MDN](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone)
    -   Includes all cases of cloning and transferring of required ECMAScript and platform types that can be polyfilled, for the details see [the caveats](https://github.com/zloirock/core-js#caveats-when-using-structuredclone-polyfill)
    -   Uses native structured cloning algorithm implementations where it's possible
    -   Includes the new semantic of errors cloning from [`html/5749`](https://github.com/whatwg/html/pull/5749)
-   Added `DOMException` polyfill, [the Web IDL spec](https://webidl.spec.whatwg.org/#idl-DOMException), [see MDN](https://developer.mozilla.org/en-US/docs/Web/API/DOMException)
    -   Includes `DOMException` and its attributes polyfills with fi…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests