Skip to content

Fix typescript side effects - #8738

Merged
danez merged 4 commits into
babel:masterfrom
yuri-karadzhov:fix-typescript-sideeffects
Jan 24, 2019
Merged

danez merged 4 commits into
babel:masterfrom
yuri-karadzhov:fix-typescript-sideeffects

Conversation

@yuri-karadzhov

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? `Fixes #8634
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? No
License MIT

@babel-bot

babel-bot commented Sep 24, 2018 •

Copy link
Copy Markdown
Collaborator

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

@danez

danez commented Nov 5, 2018 •

Copy link
Copy Markdown
Member

Thank you very much for this, could you please add a test?

If you need help with the tests feel free to join our slack chat and ask there, but basically all the tests for the transforms have a file with the input code (input.mjs) and a file with the expected output (output.mjs). To enable certain plugins you can also create a file called options.json. For example look at this test: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2

@danez danez added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: typescript awaiting reply labels Nov 5, 2018
@yuri-karadzhov

Copy link
Copy Markdown
Contributor Author

Sure will do that this week. Thanks for detailed explanation.

@yuri-karadzhov
yuri-karadzhov force-pushed the fix-typescript-sideeffects branch from c376f83 to f705f26 Compare November 13, 2018 14:19
@yuri-karadzhov

Copy link
Copy Markdown
Contributor Author

Strange, it works in application, but not in test. I will investigate.

@danez

danez commented Nov 30, 2018 •

Copy link
Copy Markdown
Member

The underlying problem was that babel-traverse was not visiting decorators which are added to params. This resulted in the identifier from the decorators never being counted as usage of a declaration (in this case the named imports). I changed the PR to reflect this. Now the test works.

The only 3 cases I could come up are identifiers, assignments and objectpatterns:

function boo (@dec() a, @dec() b = 1, @dec() { foo }) {}

rest params throw when annotated.

@yuri-karadzhov

Copy link
Copy Markdown
Contributor Author

Any updates on this PR?

@danez
danez merged commit 854313a into babel:master Jan 24, 2019
@pixelmeister

Copy link
Copy Markdown

Any ETA when this will be released? Are there nightly builds of Babel available that I could use in the interim?

@nicolo-ribaudo

Copy link
Copy Markdown
Member

Usually we release a new version every ~2 weeks

@lock lock Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Oct 4, 2019
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: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TypeScript] typescript plugin removes parameter decorators imports

6 participants