-
Notifications
You must be signed in to change notification settings - Fork 142
_Really_ don't inline dynamic imports #946
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
_Really_ don't inline dynamic imports #946
Conversation
🦋 Changeset detectedLatest commit: 30d692a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -108,6 +108,10 @@ export async function getSuspenseCacheAdaptor(): Promise<CacheAdaptor> { | |||
return getInternalCacheAdaptor('cache-api'); | |||
} | |||
|
|||
async function doImport(m: string) { |
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.
I'd add a comment clarifying what this function is for
async function doImport(m: string) { | ||
return import(m); | ||
} |
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.
I'd probably have a single doImport
function (maybe in its own file under utils/
) so that we can also add comments to it without repetition, etc..
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.
Makes sense to me 🙂 , I just left a few nits/suggestions
🧪 Prereleases are available for testing 🧪 @cloudflare/next-on-pagesYou can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/13574133319/npm-package-next-on-pages-946 @cloudflare/eslint-plugin-next-on-pagesYou can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/13574133319/npm-package-eslint-plugin-next-on-pages-946 |
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.
Looks great, thanks for the updates @penalosa 🫶
Take 2 of #940, which was still inlining dynamic imports due to esbuild's minification algorithm removing the intermediate variables.