-
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
turbopackLoaders: accept basic loader options #3540
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
crates/turbo-tasks/src/trace.rs
Outdated
@@ -73,6 +73,7 @@ ignore!( | |||
ignore!((), String, Duration, anyhow::Error); | |||
ignore!(Path, PathBuf); | |||
ignore!(serde_json::Value); | |||
ignore!(serde_json::Map<String, serde_json::Value>); |
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.
Nit: I think this is too specific, and would put it as a #[turbo_tasks(trace_ignore)]
on the struct field.
}); | ||
loaders = loaders.map((loader: any) => | ||
typeof loader === "string" | ||
? resolveLoader(loader) |
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.
Can we normalize the object here and avoid the ternary later?
Benchmark for bd04bf6
Click to view full benchmark
|
🟢 CI successful 🟢Thanks |
981e80b
to
91c3d59
Compare
Benchmark for 673fa95Click to view benchmark
|
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
…49736102+kodiakhq[bot]@users.noreply.github.com> # New Features - vercel/turborepo#3540 - vercel/turborepo#3549 - vercel/turborepo#3465 - vercel/turborepo#3550 - vercel/turborepo#3495 - vercel/turborepo#3624 - vercel/turborepo#3600 - vercel/turborepo#3676 - vercel/turborepo#3689 # Fixes - vercel/turborepo#3437 - vercel/turborepo#3542 - vercel/turborepo#3531 - vercel/turborepo#3552 - vercel/turborepo#3551 - vercel/turborepo#3597 - vercel/turborepo#3644 - vercel/turborepo#3623 - vercel/turborepo#3634 - vercel/turborepo#3574 - vercel/turborepo#3673 - vercel/turborepo#3675 - vercel/turborepo#3723 - vercel/turborepo#3677 - vercel/turborepo#3717 - vercel/turborepo#3701 # Performance Improvements - vercel/turborepo#3361 - vercel/turborepo#3619 --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
Sorry for necroing a thread but I think it would be beneficial to reflect this change in the docs. Thanks for the change! |
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
Fixes WEB-525 This allows webpack loaders defined by `experimental.turbopackLoaders` in `next.config.js` to pass serializable options to loaders. It expands `turbopackLoaders` to accept not just loader names for a given extension, but also `{loader: string, options: Object}`. These options are verified to be serializable and passed to `loader-runner` and exposed as `getOptions()` to the loader. Test Plan: Added an integration test for basic options. Verified the serializable check by passing `class Foo {}; new Foo()` as an option value and verified the error was displayed.
Fixes WEB-525
This allows webpack loaders defined by
experimental.turbopackLoaders
innext.config.js
to pass serializable options to loaders.It expands
turbopackLoaders
to accept not just loader names for a given extension, but also{loader: string, options: Object}
. These options are verified to be serializable and passed toloader-runner
and exposed asgetOptions()
to the loader.Test Plan: Added an integration test for basic options. Verified the serializable check by passing
class Foo {}; new Foo()
as an option value and verified the error was displayed.