More robust definition cache for ImportDeclaration#2279
More robust definition cache for ImportDeclaration#2279thompsongl merged 6 commits intoelastic:masterfrom
ImportDeclaration#2279Conversation
|
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 |
ExportNamedDeclarationsImportDeclaration
chandlerprall
left a comment
There was a problem hiding this comment.
Changes LGTM; pulled and ran locally against codebase, spot-checked button component files
|
Thanks again @thompsongl ! |
chandlerprall
left a comment
There was a problem hiding this comment.
still LGTM, but should have a changelog as it affects the content of built files
|
@chandlerprall Good call on the CL |
|
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