Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[babel 8] Output minimal strings by default#12675

Merged
nicolo-ribaudo merged 9 commits into
babel:mainfrom
JLHwung:backport-11384
Jan 23, 2021
Merged

[babel 8] Output minimal strings by default#12675
nicolo-ribaudo merged 9 commits into
babel:mainfrom
JLHwung:backport-11384

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented Jan 22, 2021

Q                       A
Any Dependency Changes? jsesc bumped to v3 before a flag
Documentations PR Link babel/website#2765
License MIT

This PR backports #11384 to main, for more info see that PR.

jridgewell and others added 6 commits January 22, 2021 13:42
This changes our behavior from always outputting ASCII-safe strings to outputting Unicode. It's smaller, supported since at least ES5, and maybe foreign language programmers will be less surprised with the output.
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Jan 22, 2021

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

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Jan 22, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a0d469c:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

I wish we have refactored to TypeScript.
@nicolo-ribaudo nicolo-ribaudo changed the title Output minimal strings by default [Backport #11384] [babel 8] Output minimal strings by default Jan 23, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit cd090e9 into babel:main Jan 23, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the backport-11384 branch January 23, 2021 21:50
@paranoidjk
Copy link
Copy Markdown

This is a breaking change, why this PR is not being list in changelog ? https://github.com/babel/babel/releases/tag/v7.12.13

@nicolo-ribaudo
Copy link
Copy Markdown
Member

It's not released yet, it will be released in Babel 8.

@paranoidjk
Copy link
Copy Markdown

@paranoidjk
Copy link
Copy Markdown

In my case, a demo code just like this:

import generate from '@babel/generator'
// do something to generate a tsx file ast 
    const output = generate(file, {
      jsescOption: {
        minimal: true,
      },
    });

after v7.12.13 released, the react attribute value change to unicode
image

when i lock @bable/generator to 7.12.11, it goes back to normal.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Ohh right, it's a bug introduced by this PR.
We tried not to change the default to true for Babel 7, and ended up always setting it to `false.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@paranoidjk Fixed in 7.12.15

@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 7, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 7, 2021
@nicolo-ribaudo nicolo-ribaudo added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release and removed babel 8 labels Aug 8, 2023
@JLHwung JLHwung added this to the v8.0.0 milestone Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: generator PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants