Skip to content

Commit

Permalink
Merge branch 'canary' into jrl-benchmark-tip-of-canary
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jun 5, 2023
2 parents 97db64b + 78ed08d commit 56f952a
Show file tree
Hide file tree
Showing 66 changed files with 877 additions and 788 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Expand Up @@ -16,6 +16,7 @@ linker = "aarch64-linux-musl-gcc"
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Ctarget-feature=-crt-static",
"-Clink-arg=-lgcc",
Expand All @@ -28,6 +29,7 @@ linker = "arm-linux-gnueabihf-gcc"
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
]
3 changes: 2 additions & 1 deletion .github/workflows/build_and_deploy.yml
Expand Up @@ -3,6 +3,7 @@ name: build-and-deploy
on:
push:
branches: ['canary']
workflow_dispatch:

env:
NAPI_CLI_VERSION: 2.14.7
Expand All @@ -24,7 +25,7 @@ jobs:
outputs:
docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }}
codemodChange: ${{ steps.codemod-change.outputs.CODEMOD_CHANGE }}
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
isRelease: ${{ github.event_name != 'workflow_dispatch' && steps.check-release.outputs.IS_RELEASE }}
swcChange: ${{ steps.swc-change.outputs.SWC_CHANGE }}
turboToken: ${{ steps.turbo-token.outputs.TURBO_TOKEN }}
weekNum: ${{ steps.get-week.outputs.WEEK }}
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Expand Up @@ -42,11 +42,11 @@ swc_core = { version = "0.76.37" }
testing = { version = "0.33.13" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230601.1" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230601.3" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230601.1" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230601.3" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230601.1" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230601.3" }

# General Deps

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.4.5-canary.3"
"version": "13.4.5-canary.6"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "13.4.5-canary.3",
"@next/eslint-plugin-next": "13.4.5-canary.6",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.42.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"description": "ESLint plugin for NextJS.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"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
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"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/crates/napi/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ default = ["rustls-tls"]
# when build (i.e napi --build --features plugin), same for the wasm as well.
# this is due to some of transitive dependencies have features cannot be enabled at the same time
# (i.e wasmer/default vs wasmer/js-default) while cargo merges all the features at once.
plugin = ["turbopack-binding/__swc_core_binding_napi_plugin", "next-swc/plugin"]
plugin = ["turbopack-binding/__swc_core_binding_napi_plugin", "turbopack-binding/__swc_core_binding_napi_plugin_filesystem_cache", "next-swc/plugin"]
sentry_native_tls = ["sentry", "sentry/native-tls", "native-tls"]
sentry_rustls = ["sentry", "sentry/rustls", "rustls-tls"]

Expand Down
10 changes: 0 additions & 10 deletions packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx
Expand Up @@ -191,9 +191,6 @@ async function runOperation(renderData: RenderData) {
if (prop === 'clientModules') {
return clientModulesProxy
}
if (prop === 'cssFiles') {
return new Proxy({} as any, cssFilesProxyMethods)
}
},
}
}
Expand All @@ -219,13 +216,6 @@ async function runOperation(renderData: RenderData) {
return needed
}
}
const cssFilesProxyMethods = {
get(_target: any, prop: string) {
const cssChunks = JSON.parse(prop)
// TODO(WEB-856) subscribe to changes
return cssChunks.map(toPath)
},
}
const cssImportProxyMethods = {
get(_target: any, prop: string) {
const cssChunks = JSON.parse(prop.replace(/\.js$/, ''))
Expand Down
Expand Up @@ -24,24 +24,18 @@ use crate::{
};

/// An entry in the Google fonts metrics map
#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub(super) struct FontMetricsMapEntry {
#[allow(unused)]
family_name: String,
category: String,
#[allow(unused)]
cap_height: i32,
ascent: i32,
descent: i32,
line_gap: u32,
units_per_em: u32,
#[allow(unused)]
x_height: i32,
x_width_avg: f64,
}

#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
pub(super) struct FontMetricsMap(pub HashMap<String, FontMetricsMapEntry>);

#[derive(Debug, PartialEq, Serialize, Deserialize, TraceRawVcs)]
Expand All @@ -61,49 +55,44 @@ pub(super) async fn get_font_fallback(
Some(fallback) => FontFallback::Manual(StringsVc::cell(fallback.clone())).cell(),
None => {
let metrics_json =
load_next_json(context, "/dist/server/capsize-font-metrics.json").await;
match metrics_json {
Ok(metrics_json) => {
let fallback = lookup_fallback(
&options.font_family,
metrics_json,
options.adjust_font_fallback,
);

match fallback {
Ok(fallback) => FontFallback::Automatic(
AutomaticFontFallback {
scoped_font_family: get_scoped_font_family(
FontFamilyType::Fallback.cell(),
options_vc.font_family(),
request_hash,
),
local_font_family: StringVc::cell(fallback.font_family),
adjustment: fallback.adjustment,
}
.cell(),
)
.cell(),
Err(_) => {
NextFontIssue {
path: context,
title: StringVc::cell(format!(
"Failed to find font override values for font `{}`",
&options.font_family,
)),
description: StringVc::cell(
"Skipping generating a fallback font.".to_owned(),
),
severity: IssueSeverity::Warning.cell(),
}
.cell()
.as_issue()
.emit();
FontFallback::Error.cell()
}
load_next_json(context, "/dist/server/capsize-font-metrics.json").await?;
let fallback = lookup_fallback(
&options.font_family,
metrics_json,
options.adjust_font_fallback,
);

match fallback {
Ok(fallback) => FontFallback::Automatic(
AutomaticFontFallback {
scoped_font_family: get_scoped_font_family(
FontFamilyType::Fallback.cell(),
options_vc.font_family(),
request_hash,
),
local_font_family: StringVc::cell(fallback.font_family),
adjustment: fallback.adjustment,
}
.cell(),
)
.cell(),
Err(_) => {
NextFontIssue {
path: context,
title: StringVc::cell(format!(
"Failed to find font override values for font `{}`",
&options.font_family,
)),
description: StringVc::cell(
"Skipping generating a fallback font.".to_owned(),
),
severity: IssueSeverity::Warning.cell(),
}
.cell()
.as_issue()
.emit();
FontFallback::Error.cell()
}
Err(_) => FontFallback::Error.cell(),
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
15 changes: 8 additions & 7 deletions packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "13.4.5-canary.3",
"version": "13.4.5-canary.6",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -83,12 +83,13 @@
]
},
"dependencies": {
"@next/env": "13.4.5-canary.3",
"@next/env": "13.4.5-canary.6",
"@swc/helpers": "0.5.1",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
"postcss": "8.4.14",
"styled-jsx": "5.1.1",
"watchpack": "2.4.0",
"zod": "3.21.4"
},
"peerDependencies": {
Expand Down Expand Up @@ -140,11 +141,11 @@
"@jest/types": "29.5.0",
"@napi-rs/cli": "2.14.7",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "13.4.5-canary.3",
"@next/polyfill-nomodule": "13.4.5-canary.3",
"@next/react-dev-overlay": "13.4.5-canary.3",
"@next/react-refresh-utils": "13.4.5-canary.3",
"@next/swc": "13.4.5-canary.3",
"@next/polyfill-module": "13.4.5-canary.6",
"@next/polyfill-nomodule": "13.4.5-canary.6",
"@next/react-dev-overlay": "13.4.5-canary.6",
"@next/react-refresh-utils": "13.4.5-canary.6",
"@next/swc": "13.4.5-canary.6",
"@opentelemetry/api": "1.4.1",
"@segment/ajv-human-errors": "2.1.2",
"@taskr/clear": "1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/build/index.ts
Expand Up @@ -28,7 +28,7 @@ import {
PAGES_DIR_ALIAS,
INSTRUMENTATION_HOOK_FILENAME,
} from '../lib/constants'
import { fileExists } from '../lib/file-exists'
import { FileType, fileExists } from '../lib/file-exists'
import { findPagesDir } from '../lib/find-pages-dir'
import loadCustomRoutes, {
CustomRoutes,
Expand Down Expand Up @@ -588,7 +588,7 @@ export default async function build(
for (const page in mappedPages) {
const hasPublicPageFile = await fileExists(
path.join(publicDir, page === '/' ? '/index' : page),
'file'
FileType.File
)
if (hasPublicPageFile) {
conflictingPublicFiles.push(page)
Expand Down

0 comments on commit 56f952a

Please sign in to comment.