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

perf: Remove use of simplifyAccess #16954

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Nov 4, 2024

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This may affect some very corner cases (allowCommonJSExports=false, using e.g. export??=1 and the node version does not support ??= and is not executed), But I don't think anyone does.
I haven't shown performance data because this doesn't affect the performance of the default options.

@liuxingbaoyu liuxingbaoyu added the PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories label Nov 4, 2024
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58318

@liuxingbaoyu liuxingbaoyu changed the title perf: remove use of simplifyAccess perf: Remove use of simplifyAccess Nov 4, 2024
@nicolo-ribaudo
Copy link
Member

This may affect some very corner cases (allowCommonJSExports=false, using e.g. export??=1 and the node version does not support ??= and is not executed), But I don't think anyone does.

I'm not sure I understand, could you give an example? If ?? is not supported, then users would have a plugin to transform it right?

@liuxingbaoyu
Copy link
Member Author

I'm not sure I understand, could you give an example? If ?? is not supported, then users would have a plugin to transform it right?

Yes, users should enable the corresponding plugin.

Technically, in node without ??= support, this will be turned from a hidden error into a thrown error, but I don't think anyone will do that.

if(false) {
  exports ??= {};
}

To be honest, I don't know why we should handle them in module transformation.
Perhaps we can try to change this in Babel 8.
https://github.com/babel/babel/pull/16882/files#diff-5b230a5938b6f7647f17c178c6de6138ba14109652ff7e95a6708d2e6d71a6c6R8-R22

@nicolo-ribaudo nicolo-ribaudo merged commit 38d26cd into babel:main Nov 9, 2024
54 checks passed
@Patrikoska1

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants