Unverified Commit bc06c4c1 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

refactor(turbopack): Use `ResolvedVc<T>` for struct fields in `next-core` (#73310)

<!-- 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 b31ee944
...@@ -166,8 +166,10 @@ impl NextSegmentConfig { ...@@ -166,8 +166,10 @@ impl NextSegmentConfig {
/// An issue that occurred while parsing the app segment config. /// An issue that occurred while parsing the app segment config.
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
pub struct NextSegmentConfigParsingIssue { pub struct NextSegmentConfigParsingIssue {
// no-resolved-vc(kdy1): I'll resolve this later because it's a complex case.
ident: Vc<AssetIdent>, ident: Vc<AssetIdent>,
detail: ResolvedVc<StyledString>, detail: ResolvedVc<StyledString>,
// no-resolved-vc(kdy1): I'll resolve this later because it's a complex case.
source: Vc<IssueSource>, source: Vc<IssueSource>,
} }
...@@ -433,6 +435,7 @@ fn parse_config_value( ...@@ -433,6 +435,7 @@ fn parse_config_value(
"Values of the `preferredRegion` array need to static strings", "Values of the `preferredRegion` array need to static strings",
&item, &item,
); );
return;
} }
} }
regions regions
......
...@@ -540,7 +540,7 @@ fn match_parallel_route(name: &str) -> Option<&str> { ...@@ -540,7 +540,7 @@ fn match_parallel_route(name: &str) -> Option<&str> {
fn conflict_issue( fn conflict_issue(
app_dir: Vc<FileSystemPath>, app_dir: Vc<FileSystemPath>,
e: &OccupiedEntry<AppPath, Entrypoint>, e: &'_ OccupiedEntry<'_, AppPath, Entrypoint>,
a: &str, a: &str,
b: &str, b: &str,
value_a: &AppPage, value_a: &AppPage,
...@@ -1419,6 +1419,7 @@ pub async fn get_global_metadata( ...@@ -1419,6 +1419,7 @@ pub async fn get_global_metadata(
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
struct DirectoryTreeIssue { struct DirectoryTreeIssue {
pub severity: ResolvedVc<IssueSeverity>, pub severity: ResolvedVc<IssueSeverity>,
// no-resolved-vc(kdy1): I'll resolve this later because it's a complex case.
pub app_dir: Vc<FileSystemPath>, pub app_dir: Vc<FileSystemPath>,
pub message: ResolvedVc<StyledString>, pub message: ResolvedVc<StyledString>,
} }
......
...@@ -109,6 +109,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin { ...@@ -109,6 +109,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin {
let font_fallbacks = get_font_fallbacks(lookup_path, options_vc); let font_fallbacks = get_font_fallbacks(lookup_path, options_vc);
let properties = get_font_css_properties(options_vc, font_fallbacks).await; let properties = get_font_css_properties(options_vc, font_fallbacks).await;
let lookup_path = lookup_path.to_resolved().await?;
if let Err(e) = &properties { if let Err(e) = &properties {
for source_error in e.chain() { for source_error in e.chain() {
if let Some(FontError::FontFileNotFound(font_path)) = if let Some(FontError::FontFileNotFound(font_path)) =
...@@ -319,7 +320,7 @@ async fn font_file_options_from_query_map( ...@@ -319,7 +320,7 @@ async fn font_file_options_from_query_map(
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
struct FontResolvingIssue { struct FontResolvingIssue {
font_path: ResolvedVc<RcStr>, font_path: ResolvedVc<RcStr>,
origin_path: Vc<FileSystemPath>, origin_path: ResolvedVc<FileSystemPath>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -331,7 +332,7 @@ impl Issue for FontResolvingIssue { ...@@ -331,7 +332,7 @@ impl Issue for FontResolvingIssue {
#[turbo_tasks::function] #[turbo_tasks::function]
fn file_path(&self) -> Vc<FileSystemPath> { fn file_path(&self) -> Vc<FileSystemPath> {
self.origin_path *self.origin_path
} }
#[turbo_tasks::function] #[turbo_tasks::function]
......
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