Skip to content

Commit

Permalink
[Turbopack] refactoring/todos (#69663)
Browse files Browse the repository at this point in the history
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 #

-->
  • Loading branch information
sokra authored Sep 5, 2024
1 parent 4a4ff6c commit c14e435
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 8 additions & 2 deletions packages/next/src/server/dev/hot-reloader-turbopack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions turbopack/crates/turbo-tasks/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}

Expand Down Expand Up @@ -748,7 +748,7 @@ pub(crate) mod tests {
arg: Box::new(()),
}
.get_name(),
"MockTrait::mock_method_task",
"*MockTrait::mock_method_task",
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.?
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c14e435

Please sign in to comment.