Skip to content
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

[pull] canary from vercel:canary #15

Merged
merged 9 commits into from
Jan 11, 2025
2 changes: 1 addition & 1 deletion .github/actions/next-repo-actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"description": "Notify Next.js team about pending PRs and popular issues",
"description": "A variety of functions to help with triaging issues, PRs, and feature requests in the Next.js repo.",
"scripts": {
"build-issues-by-version": "ncc build src/issues-by-version.ts -m -o dist/issues-by-version --license licenses.txt",
"build-issues": "ncc build src/popular-issues.mjs -m -o dist/issues --license licenses.txt",
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/issue_stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'vercel'
steps:
- uses: actions/stale@v9
id: issue-stale
name: 'Mark stale issues, close stale issues'
with:
repo-token: ${{ secrets.STALE_TOKEN }}
ascending: true
days-before-issue-stale: 730 # issues with no activity in over two years
days-before-issue-close: 7
days-before-pr-close: -1
days-before-pr-stale: -1
remove-issue-stale-when-updated: true
stale-issue-label: 'stale'
stale-issue-message: 'This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.'
close-issue-message: 'This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
- uses: actions/stale@v9
id: stale-no-repro
name: 'Close stale issues with no reproduction'
Expand All @@ -21,7 +36,6 @@ jobs:
days-before-issue-stale: 2
days-before-pr-close: -1
days-before-pr-stale: -1
exempt-issue-labels: 'blocked,must,should,keep'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
- uses: actions/stale@v9
id: stale-simple-repro
Expand All @@ -34,7 +48,6 @@ jobs:
days-before-issue-stale: 14
days-before-pr-close: -1
days-before-pr-stale: -1
exempt-issue-labels: 'blocked,must,should,keep'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
- uses: actions/stale@v9
id: stale-no-canary
Expand All @@ -47,5 +60,4 @@ jobs:
days-before-issue-stale: 14
days-before-pr-close: -1
days-before-pr-stale: -1
exempt-issue-labels: 'blocked,must,should,keep'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
12 changes: 6 additions & 6 deletions crates/next-api/src/module_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ impl NextDynamicGraph {

// module -> the client reference entry (if any)
let mut state_map = HashMap::new();
graph.traverse_edges_from_entry(entry, |(parent_node, node)| {
graph.traverse_edges_from_entry(entry, |parent_info, node| {
let module = node.module;
let Some(parent_node) = parent_node else {
let Some((parent_node, _)) = parent_info else {
state_map.insert(module, VisitState::Entry);
return GraphTraversalAction::Continue;
};
Expand Down Expand Up @@ -362,9 +362,9 @@ impl ClientReferencesGraph {
entry,
// state_map is `module -> Option< the current so parent server component >`
&mut HashMap::new(),
|(parent_node, node), state_map| {
|parent_info, node, state_map| {
let module = node.module;
let Some(parent_node) = parent_node else {
let Some((parent_node, _)) = parent_info else {
state_map.insert(module, None);
return GraphTraversalAction::Continue;
};
Expand All @@ -390,8 +390,8 @@ impl ClientReferencesGraph {
_ => GraphTraversalAction::Continue,
}
},
|(parent_node, node), state_map| {
let Some(parent_node) = parent_node else {
|parent_info, node, state_map| {
let Some((parent_node, _)) = parent_info else {
return;
};
let parent_module = parent_node.module;
Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async fn build_manifest(
&key,
ActionManifestWorkerEntry {
module_id: ActionManifestModuleId::String(loader_id.as_str()),
is_async: *chunk_item.is_self_async().await?,
is_async: *chunk_item.module().is_self_async().await?,
},
);
entry.layer.insert(&key, *layer);
Expand Down
52 changes: 30 additions & 22 deletions crates/next-core/src/next_manifests/client_reference_manifest.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use anyhow::Result;
use anyhow::{Context, Result};
use indoc::formatdoc;
use turbo_rcstr::RcStr;
use turbo_tasks::{FxIndexSet, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc};
use turbo_tasks_fs::{File, FileSystemPath};
use turbopack_core::{
asset::{Asset, AssetContent},
chunk::{
availability_info::AvailabilityInfo, ChunkItem, ChunkItemExt, ChunkableModule,
ChunkingContext, ModuleId as TurbopackModuleId,
availability_info::AvailabilityInfo, ChunkItemExt, ChunkableModule, ChunkingContext,
ModuleId as TurbopackModuleId,
},
output::{OutputAsset, OutputAssets},
virtual_output::VirtualOutputAsset,
Expand Down Expand Up @@ -75,8 +75,8 @@ impl ClientReferenceManifest {

let server_path = ecmascript_client_reference.server_ident.to_string().await?;

let client_chunk_item = ecmascript_client_reference
.client_module
let client_module = ecmascript_client_reference.client_module;
let client_chunk_item = client_module
.as_chunk_item(Vc::upcast(client_chunking_context))
.to_resolved()
.await?;
Expand Down Expand Up @@ -107,28 +107,32 @@ impl ClientReferenceManifest {
.map(RcStr::from)
.collect::<Vec<_>>();

let is_async =
is_item_async(client_availability_info, client_chunk_item).await?;
let is_async = is_item_async(
client_availability_info,
ResolvedVc::upcast(client_module),
)
.await?;

(chunk_paths, is_async)
} else {
(Vec::new(), false)
};

if let Some(ssr_chunking_context) = ssr_chunking_context {
let ssr_chunk_item = ecmascript_client_reference
.ssr_module
let ssr_module = ecmascript_client_reference.ssr_module;
let ssr_chunk_item = ssr_module
.as_chunk_item(Vc::upcast(ssr_chunking_context))
.to_resolved()
.await?;
let ssr_module_id = ssr_chunk_item.id().await?;

let rsc_chunk_item: ResolvedVc<Box<dyn ChunkItem>> =
ResolvedVc::try_downcast_type::<EcmascriptClientReferenceProxyModule>(
parent_module,
)
.await?
.unwrap()
let rsc_module = ResolvedVc::try_downcast_type::<
EcmascriptClientReferenceProxyModule,
>(parent_module)
.await?
.context("Expected EcmascriptClientReferenceProxyModule")?;

let rsc_chunk_item = rsc_module
.as_chunk_item(Vc::upcast(ssr_chunking_context))
.to_resolved()
.await?;
Expand Down Expand Up @@ -161,7 +165,9 @@ impl ClientReferenceManifest {
.map(RcStr::from)
.collect::<Vec<_>>();

let is_async = is_item_async(ssr_availability_info, ssr_chunk_item).await?;
let is_async =
is_item_async(ssr_availability_info, ResolvedVc::upcast(ssr_module))
.await?;

(chunk_paths, is_async)
} else {
Expand All @@ -188,9 +194,11 @@ impl ClientReferenceManifest {
.map(RcStr::from)
.collect::<Vec<_>>();

let is_async =
is_item_async(&rsc_app_entry_chunks_availability, rsc_chunk_item)
.await?;
let is_async = is_item_async(
&rsc_app_entry_chunks_availability,
ResolvedVc::upcast(rsc_module),
)
.await?;

(chunk_paths, is_async)
};
Expand Down Expand Up @@ -368,13 +376,13 @@ pub fn get_client_reference_module_key(server_path: &str, export_name: &str) ->

async fn is_item_async(
availability_info: &AvailabilityInfo,
chunk_item: ResolvedVc<Box<dyn ChunkItem>>,
module: ResolvedVc<Box<dyn ChunkableModule>>,
) -> Result<bool> {
let Some(available_chunk_items) = availability_info.available_chunk_items() else {
let Some(available_modules) = availability_info.available_modules() else {
return Ok(false);
};

let Some(info) = available_chunk_items.await?.get(chunk_item).await? else {
let Some(info) = &*available_modules.get(*module).await? else {
return Ok(false);
};

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "15.2.0-canary.3"
"version": "15.2.0-canary.4"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
"dependencies": {
"@next/eslint-plugin-next": "15.2.0-canary.3",
"@next/eslint-plugin-next": "15.2.0-canary.4",
"@rushstack/eslint-patch": "^1.10.3",
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/font",
"private": true,
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "15.2.0-canary.3",
"version": "15.2.0-canary.4",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -99,7 +99,7 @@
]
},
"dependencies": {
"@next/env": "15.2.0-canary.3",
"@next/env": "15.2.0-canary.4",
"@swc/counter": "0.1.3",
"@swc/helpers": "0.5.15",
"busboy": "1.6.0",
Expand Down Expand Up @@ -164,11 +164,11 @@
"@jest/types": "29.5.0",
"@mswjs/interceptors": "0.23.0",
"@napi-rs/triples": "1.2.0",
"@next/font": "15.2.0-canary.3",
"@next/polyfill-module": "15.2.0-canary.3",
"@next/polyfill-nomodule": "15.2.0-canary.3",
"@next/react-refresh-utils": "15.2.0-canary.3",
"@next/swc": "15.2.0-canary.3",
"@next/font": "15.2.0-canary.4",
"@next/polyfill-module": "15.2.0-canary.4",
"@next/polyfill-nomodule": "15.2.0-canary.4",
"@next/react-refresh-utils": "15.2.0-canary.4",
"@next/swc": "15.2.0-canary.4",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.41.2",
"@storybook/addon-essentials": "^8.4.7",
Expand Down
Loading
Loading