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

feat: add es2021 target #6899

Merged
merged 4 commits into from
Jun 5, 2024
Merged

feat: add es2021 target #6899

merged 4 commits into from
Jun 5, 2024

Conversation

luhc228
Copy link
Collaborator

@luhc228 luhc228 commented May 31, 2024

Background

Currently, rax-compat export esm(ES Module + ES5) outputs by default, but it imports many helper functions from @swc/helpers and it will slow down the runtime like SSR. At this time, the node version installed in the server is 18.x or higher so it supports es2019 or higher syntax. For more detail, please see https://node.green/

What this PR do?

Now rax-compat will exports es2021 outputs. We can consume the es2021 outouts with bundlers.

For example, we can specify the resolve.conditionName in webpack config to import them:

export default {
  resolve: {
    conditionNames: ['es2021', '...']
  }
}

@luhc228 luhc228 marked this pull request as draft May 31, 2024 02:52
@luhc228 luhc228 requested review from linbudu599 and wssgcg1213 June 3, 2024 03:00
@luhc228 luhc228 marked this pull request as ready for review June 3, 2024 03:01
@luhc228 luhc228 added the need review Need Review label Jun 3, 2024
@luhc228 luhc228 self-assigned this Jun 3, 2024
@luhc228 luhc228 requested a review from ClarkXia June 3, 2024 03:11
linbudu599
linbudu599 previously approved these changes Jun 3, 2024
ClarkXia
ClarkXia previously approved these changes Jun 4, 2024
@luhc228 luhc228 changed the base branch from master to release/next June 4, 2024 10:11
@luhc228 luhc228 dismissed stale reviews from ClarkXia and linbudu599 June 4, 2024 10:11

The base branch was changed.

@luhc228 luhc228 requested review from ClarkXia and linbudu599 June 4, 2024 10:11
@luhc228 luhc228 merged commit 9926faa into release/next Jun 5, 2024
7 checks passed
@luhc228 luhc228 deleted the feat/add-es2021-target branch June 5, 2024 02:24
@ClarkXia ClarkXia mentioned this pull request Jun 17, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need review Need Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants