-
Notifications
You must be signed in to change notification settings - Fork 842
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
More robust definition cache for ImportDeclaration
#2279
Conversation
This re-introduces the possibility of an infinite dependency loop, for example adding The bug - as demonstrated by the files within components/button - is that the first time a file is imported its resulting imports are cached -- however, those results are pruned by the named variables being imported which causes the cache to be invalid. e.g. given the two imports in two different files: the script encounters the first file and caches Two potential ideas for fixing don't prune exportsSimply commenting out the
change cache keyInstead of looking up caches by the resolved file path, the key could instead be the concatenation of the importing file + imported file. This allows pruning to remain as is while resolving the underlying bug. I think I prefer option 2 as it touches less code and only introduces very marginal complexity. |
Thanks for the deep look @chandlerprall |
ExportNamedDeclarations
ImportDeclaration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM; pulled and ran locally against codebase, spot-checked button component files
Thanks again @thompsongl ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still LGTM, but should have a changelog as it affects the content of built files
@chandlerprall Good call on the CL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Thanks for fixing it :) |
* bypass the cache for exportnameddeclarations * dont set the cache either * use alternate cache key * CL
Summary
Fixes #2271, in which some type definition exports remained in the
es/
compilation step.See comment below for full detail and solution.
Checklist
- [ ] Checked in dark mode- [ ] Checked in mobile- [ ] Checked in IE11 and Firefox- [ ] Props have proper autodocs- [ ] Added documentation examples- [ ] Added or updated jest tests- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes