Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(runtime): add lazy load for addtl bundlers (#3364)
* fix(runtime): add lazy load for addtl bundlers this commit adds experimental support for using stencil component libraries in projects that use bundlers such as vite. prior to this commit, stencil component libraries that were used in projects that used such bundlers would have issues lazily-loading components at runtime. this is due to restrictions the bundlers themselves place on the filepaths that can be used in dynamic import statements. this commit does not introduce the ability for stencil's compiler to use bundlers other than rollup under the hood. it only permits a compiled component library (that uses the `dist` output target) to be used in an application that uses a bundler built atop of rollup. due to the restrictions that rollup may impose on dynamic imports, this commit adds the ability to add an explicit `import()` statement for each lazily-loadable bundle. in order to keep the runtime small, this feature is hidden behind a new feature flag, `experimentalImportInjection` this pr build's atop the work done by @johnjenkins in #2959 and the test cases provided by @PrinceManfred in #2959 (comment). Without their contributions, this commit would not have been possible. STENCIL-339: Integrate Bundler Functionality * review(ap): remove unnecessary nested `Promise.all` calls remove two nested `Promise.all` calls - after moving writing lazily loadable chunks out of the outermost `Promise.all` call, we were awaiting a single promise wrapped in an array. this commit simplifies the code
- Loading branch information
1 parent
de7ec55
commit 25cef1e
Showing
4 changed files
with
127 additions
and
33 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