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

Skip to content

Type checking preset-typescript options#12460

Merged
nicolo-ribaudo merged 9 commits intobabel:mainfrom
JLHwung:type-checking-preset-typescript-options
Jan 7, 2021
Merged

Type checking preset-typescript options#12460
nicolo-ribaudo merged 9 commits intobabel:mainfrom
JLHwung:type-checking-preset-typescript-options

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Dec 8, 2020

Q                       A
Major: Breaking Change? Yes but behind the BABEL_8_BREAKING flags
Tests Added + Pass? Yes
License MIT

This PR was derived from #10927. It focuses on checking @babel/preset-typescript options only.

It uses the BABEL_8_BREAKING env flags so we can test the Babel 8 behaviour on main. It includes commits from #12457. Just realized that this PR does not depend on that one. Rebased.

@babel-bot
Copy link
Collaborator

babel-bot commented Dec 8, 2020

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

@JLHwung JLHwung force-pushed the type-checking-preset-typescript-options branch from 6c7f049 to c2a73b9 Compare December 8, 2020 21:18
@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 8, 2020

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 22c5830:

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

@JLHwung JLHwung force-pushed the type-checking-preset-typescript-options branch from 430c0d4 to d654eed Compare December 8, 2020 21:54
Comment on lines +4 to +15
let old_babel_8_breaking_env;
beforeAll(() => {
old_babel_8_breaking_env = process.env.BABEL_8_BREAKING;
process.env.BABEL_8_BREAKING = "1";
});
afterAll(() => {
if (old_babel_8_breaking_env) {
process.env.BABEL_8_BREAKING = old_babel_8_breaking_env;
} else {
delete process.env.BABEL_8_BREAKING;
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we run tests with the BABEL_8_BREAKING flag on CI (and we can manually do it locally), we don't need to set it here.

I'm worried that this will fail on make prepublish, since in the prepublish build we strip the BABEL_8_BREAKING checks in the compiled code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it is pretty scary that the make prepublish actually passed. 😂

I will skip the test if BABEL_8_BREAKING does not present.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it is pretty scary that the make prepublish actually passed. 😂

I'm investigating 😁

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, the test is not failing because it imports src, so the source is compiled just-in-time by Jest regardless of what we have in lib.

@JLHwung JLHwung requested a review from existentialism January 6, 2021 17:50
@nicolo-ribaudo nicolo-ribaudo merged commit ff52ace into babel:main Jan 7, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the type-checking-preset-typescript-options branch January 7, 2021 19:59
@JLHwung JLHwung mentioned this pull request Feb 3, 2021
34 tasks
@JLHwung JLHwung added this to the Babel 8.0 milestone Feb 3, 2021
@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 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
@nicolo-ribaudo nicolo-ribaudo added babel 8 PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release and removed babel-8-dev → main labels Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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.

4 participants