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

fix: downgrade typescript to fix dynamic import issue #1475

Merged
merged 1 commit into from Mar 21, 2023

Conversation

ttacon
Copy link

@ttacon ttacon commented Mar 21, 2023

When I updated several packages, I also update TypeScript by a few minor versions - it is rare, but this caught a bug with a new TypeScript version. TypeScript 4.9 introduced a change that altered how dynamic imports worked (see attached screenshot for the issue in the changelog for TS 4.9). This change, cause dynamic imports to be transpiled from:

Promise.resolve().then(function () { return require(x); })

to

(_a = x, Promise.resolve().then(() => require(_a))

When transpiling to a CommonJS module format, which we are doing. This is a problem, because while Webpack tree-shaking can determine asset relevance in the first example, it cannot in the second.

This PR forces the TS resolution to stop at 4.8.4, which removes this change and maintains the prior transpilation of the Icon component.

Screen Shot 2023-03-21 at 12 12 04 PM

@ttacon ttacon merged commit dced0de into v4 Mar 21, 2023
5 checks passed
@ttacon ttacon deleted the trey/fix-ts-induced-issue branch March 21, 2023 16:26
@github-actions
Copy link

🎉 This PR is included in version 4.0.0-alpha.170 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants