-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues when using colocated component's with decorators.
The changes made in f9053bc added the ability to detect `export { Foo as default }` along side the ability to detect `export default Foo`. When ran in isolation (or with the `@babel/plugin-transform-typescript`) this works fine, but in common scenarios without typescript support it failed. The cause of the failure is a bit difficult to grok, but _basically_ it is because when our `ExportDefaultDeclaration` hook is hit, we add the `setComponentTemplate` invocation. Then **subsequently** another plugin changes from `export default Foo` to `export { Foo as default }` (the combination of `@babel/plugin-proposal-decorators` and `@babel/plugin-proposal-class-fields` does this), and we run the new `ExportNamedDeclaration` which causes us to add `setComponentTemplate` invocation **_again_**. The fix added here ensures that _only **one**_ `setComponentTemplate` invocation will be added (even if we see both `export default Foo` and `export { Foo as default }` during traversal).
- Loading branch information
Showing
4 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters