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

Update babel.config.js so build artifacts are compiled to ES5. #3304

Merged
merged 1 commit into from Dec 21, 2022

Conversation

nickgros
Copy link
Contributor

Reasons for making this change

dts-cli will utilize the babel.config.js file on build. The targets option for the @babel/preset-env plugin will determine what features the compiled output will target. Per babel docs:

When no targets are specified: Babel will assume you are targeting the oldest browsers possible. For example, @babel/preset-env will transform all ES2015-ES2020 code to be ES5 compatible.

This approach will allow us to continue to write ESNext code while we can be confident RJSF users will still consume ES5 code.

Fixes #3240

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

dts-cli will utilize the babel.config.js file on build. The `targets` option for the @babel/preset-env plugin will determine what features the compiled output will target. Per babel docs:

 > When no targets are specified: Babel will assume you are targeting the oldest browsers possible. For example, @babel/preset-env will transform all ES2015-ES2020 code to be ES5 compatible.

 This approach will allow us to continue to write ESNext code while we can be confident RJSF users will still consume ES5 code.
@heath-freenome heath-freenome merged commit dea44c2 into rjsf-team:main Dec 21, 2022
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
…team#3304)

dts-cli will utilize the babel.config.js file on build. The `targets` option for the @babel/preset-env plugin will determine what features the compiled output will target. Per babel docs:

 > When no targets are specified: Babel will assume you are targeting the oldest browsers possible. For example, @babel/preset-env will transform all ES2015-ES2020 code to be ES5 compatible.

 This approach will allow us to continue to write ESNext code while we can be confident RJSF users will still consume ES5 code.
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
…team#3304)

dts-cli will utilize the babel.config.js file on build. The `targets` option for the @babel/preset-env plugin will determine what features the compiled output will target. Per babel docs:

 > When no targets are specified: Babel will assume you are targeting the oldest browsers possible. For example, @babel/preset-env will transform all ES2015-ES2020 code to be ES5 compatible.

 This approach will allow us to continue to write ESNext code while we can be confident RJSF users will still consume ES5 code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Failing to build run storybook when importing RJSF
2 participants