Unverified Commit c14e4354 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

[Turbopack] refactoring/todos (#69663)

add TODO

fix function name

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
parent 4a4ff6c0
......@@ -126,6 +126,13 @@ export async function createHotReloaderTurbopack(
hotReloaderSpan.stop()
const encryptionKey = await generateEncryptionKeyBase64(true)
// TODO: Implement
let clientRouterFilters: any
if (nextConfig.experimental.clientRouterFilter) {
// TODO this need to be set correctly for persistent caching to work
}
const project = await bindings.turbo.createProject(
{
projectPath: dir,
......@@ -137,8 +144,7 @@ export async function createHotReloaderTurbopack(
env: process.env as Record<string, string>,
defineEnv: createDefineEnv({
isTurbopack: true,
// TODO: Implement
clientRouterFilters: undefined,
clientRouterFilters,
config: nextConfig,
dev: true,
distDir,
......
......@@ -312,18 +312,18 @@ impl CachedTaskType {
fn_type: native_fn,
this: _,
arg: _,
}
| Self::ResolveNative {
} => Cow::Borrowed(&registry::get_function(*native_fn).name),
Self::ResolveNative {
fn_type: native_fn,
this: _,
arg: _,
} => Cow::Borrowed(&registry::get_function(*native_fn).name),
} => format!("*{}", registry::get_function(*native_fn).name).into(),
Self::ResolveTrait {
trait_type: trait_id,
method_name: fn_name,
this: _,
arg: _,
} => format!("{}::{}", registry::get_trait(*trait_id).name, fn_name).into(),
} => format!("*{}::{}", registry::get_trait(*trait_id).name, fn_name).into(),
}
}
......@@ -748,7 +748,7 @@ pub(crate) mod tests {
arg: Box::new(()),
}
.get_name(),
"MockTrait::mock_method_task",
"*MockTrait::mock_method_task",
);
}
}
......@@ -6,7 +6,7 @@ error - [code gen] [project]/turbopack/crates/turbopack-tests/tests/snapshot/imp
Debug info:
- An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)
- Execution of EcmascriptChunkItemContent::module_factory failed
- Execution of *EcmascriptChunkItemContent::module_factory failed
- Execution of <JsonChunkItem as EcmascriptChunkItem>::content failed
- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26
at nested.?
......
......@@ -6,7 +6,7 @@ __turbopack_export_value__(JSON.parse("{\"name\":\"json-snapshot\"}"));
})()),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)": (() => {{
throw new Error("An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)\n\nCaused by:\n- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26\n\nDebug info:\n- An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)\n- Execution of EcmascriptChunkItemContent::module_factory failed\n- Execution of <JsonChunkItem as EcmascriptChunkItem>::content failed\n- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26\n at nested.?\n 1 | {\n 2 | \"nested\": {\n | v\n 3 + \"this-is\": \"invalid\" // lint-staged will remove trailing commas, so here's a comment\n | ^\n 4 | }\n 5 | }");
throw new Error("An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)\n\nCaused by:\n- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26\n\nDebug info:\n- An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)\n- Execution of *EcmascriptChunkItemContent::module_factory failed\n- Execution of <JsonChunkItem as EcmascriptChunkItem>::content failed\n- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26\n at nested.?\n 1 | {\n 2 | \"nested\": {\n | v\n 3 + \"this-is\": \"invalid\" // lint-staged will remove trailing commas, so here's a comment\n | ^\n 4 | }\n 5 | }");
}}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/index.js [test] (ecmascript)": (({ r: __turbopack_require__, f: __turbopack_module_context__, i: __turbopack_import__, s: __turbopack_esm__, v: __turbopack_export_value__, n: __turbopack_export_namespace__, c: __turbopack_cache__, M: __turbopack_modules__, l: __turbopack_load__, j: __turbopack_dynamic__, P: __turbopack_resolve_absolute_path__, U: __turbopack_relative_url__, R: __turbopack_resolve_module_id_path__, g: global, __dirname }) => (() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment