-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
loaders: use pre-compiled loader-runner distributed with Next.js #3823
Conversation
The benefit of this depends on vercel/next.js#45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including vercel/next.js#45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Ignored Deployments
|
|
Depends on #45962 and vercel/turborepo#3823. This adds an example app that uses webpack loaders with Turbopack. It configures and uses the `@svgr/webpack` loader to transform svg assets into JavaScript as React components. Test Plan: `pnpm next-with-deps --turbo ./examples/with-turbopack-loaders`
Benchmark for 5868925Click to view benchmark
|
Benchmark for 8bf2bb9Click to view benchmark
|
|
||
#[turbo_tasks::function] | ||
pub async fn get_external_next_compiled_package_mapping( | ||
package_name: StringVc, |
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.
package_name: StringVc, | |
package_name: &str, |
try { | ||
({ runLoaders } = require("@vercel/turbopack/loader-runner")); | ||
} catch { | ||
({ runLoaders } = __turbopack_external_require__("loader-runner")); |
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 think this should be removed
Performance Improvements: * vercel/turborepo#3849 Misc: * vercel/turborepo#3850 * vercel/turborepo#3861 * vercel/turborepo#3823
# Performance Improvements: * vercel/turborepo#3849 * vercel/turborepo#3878 * vercel/turborepo#3864 # Misc: * vercel/turborepo#3847 * vercel/turborepo#3865 * vercel/turborepo#3850 * vercel/turborepo#3861 * vercel/turborepo#3823 * vercel/turborepo#3882 # Contributing * Update profiling instructions for macOS ([#3837](vercel/turborepo#3837))
…cel/turborepo#3823) The benefit of this depends on #45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including #45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
…cel/turborepo#3823) The benefit of this depends on #45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including #45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
…cel/turborepo#3823) The benefit of this depends on #45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including #45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
…cel/turborepo#3823) The benefit of this depends on #45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including #45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
…cel/turborepo#3823) The benefit of this depends on #45962, but it remains compatible with apps including `loader-runner`. This first attempts to require `loader-runner` from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package. Test Plan: Linked a local copy of Next.js including #45962 to an app without `loader-runner` that uses loaders and verified loaders ran.
The benefit of this depends on vercel/next.js#45962, but it remains compatible with apps including
loader-runner
.This first attempts to require
loader-runner
from the app's installed version of Next.js, falling back to requiring the package directly. We should probably eventually remove this fallback once all compatible versions of Next.js include the precompiled version, as that has a more predictable version of the package.Test Plan: Linked a local copy of Next.js including vercel/next.js#45962 to an app without
loader-runner
that uses loaders and verified loaders ran.