10000 Merge branch 'canary' into fix/typo · vercel/next.js@d3a436e · GitHub
[go: up one dir, main page]

Skip to content

Commit d3a436e

Browse files
authored
Merge branch 'canary' into fix/typo
2 parents 0b7a9cc + a0993d9 commit d3a436e

File tree

94 files changed

+4203
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4203
-499
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ jobs:
606606
# New release process
607607
- name: Publish to NPM
608608
id: changesets
609+
# TODO: Change to IS_RELEASE condition when new release becomes stable.
609610
if: ${{ env.__NEW_RELEASE == 'true' }}
610611
uses: changesets/action@v1
611612
with:
@@ -615,6 +616,8 @@ jobs:
615616
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
616617

617618
- name: Send a Slack notification of the publish status
619+
# TODO: Change to IS_RELEASE condition when new release becomes stable.
620+
if: ${{ env.__NEW_RELEASE == 'true' && (steps.changesets.outputs.published == 'true' || steps.changesets.outputs.published == 'false') }}
618621
run: pnpm tsx scripts/release/slack.ts
619622
env:
620623
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}

.github/workflows/test-turbopack-rust-bench-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
check-latest: true
4343
- run: corepack enable
4444

45+
# We need to install the dependencies for the benchmark apps
46+
- run: pnpm install
47+
working-directory: turbopack/benchmark-apps
48+
4549
- name: Build benchmarks for tests
4650
timeout-minutes: 120
4751
run: |

.github/workflows/turbopack-benchmark.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ env:
2525
CARGO_INCREMENTAL: 0
2626
# For faster CI
2727
RUST_LOG: 'off'
28+
TURBO_TEAM: 'vercel'
29+
TURBO_CACHE: 'remote:rw'
30+
TURBO_TOKEN: ${{ secrets.HOSTED_TURBO_TOKEN }}
2831

2932
jobs:
30-
benchmark-small:
31-
name: Benchmark Rust Crates (small)
33+
benchmark-tiny:
34+
name: Benchmark Rust Crates (tiny)
3235
runs-on: ubuntu-22.04
3336
steps:
3437
- uses: actions/checkout@v4
@@ -50,6 +53,43 @@ jobs:
5053
run: cargo codspeed run
5154
token: ${{ secrets.CODSPEED_TOKEN }}
5255

56+
benchmark-small-apps:
57+
name: Benchmark Rust Crates (small apps)
58+
runs-on: ubuntu-22.04
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Setup Rust toolchain
63+
uses: ./.github/actions/setup-rust
64+
65+
- name: Install cargo-codspeed
66+
uses: taiki-e/install-action@v2
67+
with:
68+
tool: cargo-codspeed@2.10.1
69+
70+
- name: Cache on ${{ github.ref_name }}
71+
uses: ijjk/rust-cache@turbo-cache-v1.0.8
72+
with:
73+
save-if: 'true'
74+
cache-provider: 'turbo'
75+
shared-key: build-turbopack-benchmark-small-apps-${{ hashFiles('.cargo/config.toml') }}
76+
77+
- name: Install pnpm dependencies
78+
working-directory: turbopack/benchmark-apps
79+
run: |
80+
npm i -g corepack@0.31
81+
corepack enable
82+
pnpm install --loglevel error
83+
84+
- name: Build app build benchmarks
85+
run: cargo codspeed build -p turbopack-cli small_apps
86+
87+
- name: Run the benchmarks
88+
uses: CodSpeedHQ/action@v3
89+
with:
90+
run: cargo codspeed run
91+
token: ${{ secrets.CODSPEED_TOKEN }}
92+
5393
benchmark-large:
5494
name: Benchmark Rust Crates (large)
5595
# If the task is triggered manually, we want to run the large benchmarks

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"version": "15.4.0-canary.56"
19+
"version": "15.4.0-canary.57"
2020
}

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "15.4.0-canary.56",
3+
"version": "15.4.0-canary.57",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "15.4.0-canary.56",
3+
"version": "15.4.0-canary.57",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "15.4.0-canary.56",
13+
"@next/eslint-plugin-next": "15.4.0-canary.57",
1414
"@rushstack/eslint-patch": "^1.10.3",
1515
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
1616
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",

packages/eslint-plugin-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "15.4.0-canary.56",
3+
"version": "15.4.0-canary.57",
44
"description": "ESLint plugin for Next.js.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/font/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@next/font",
33
"private": true,
4-
"version": "15.4.0-canary.56",
4+
"version": "15.4.0-canary.57",
55
"repository": {
66
"url": "vercel/next.js",
77
"directory": "packages/font"

packages/font/src/local/loader.test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,36 @@ describe('next/font/local loader', () => {
229229
"
230230
`)
231231
})
232+
233+
test('Custom font-family in declarations', async () => {
234+
const { css } = await nextFontLocalFontLoader({
235+
functionName: '',
236+
data: [
237+
{
238+
src: './my-font.woff2',
239+
declarations: [{ prop: 'font-family', value: 'Custom Font' }],
240+
},
241+
],
242+
emitFontFile: () => '/_next/static/media/my-font.woff2',
243+
resolve: jest.fn(),
244+
isDev: false,
245+
isServer: true,
246+
variableName: 'myFont',
247+
loaderContext: {
248+
fs: {
249+
readFile: (_: string, cb: any) => cb(null, 'fontdata'),
250+
},
251+
} as any,
252+
})
253+
254+
expect(css).toMatchInlineSnapshot(`
255+
"@font-face {
256+
font-family: Custom Font;
257+
src: url(/_next/static/media/my-font.woff2) format('woff2');
258+
font-display: swap;
259+
}
260+
"
261+
`)
262+
})
232263
})
233264
})

packages/font/src/local/loader.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ const nextFontLocalFontLoader: FontLoader = async ({
5454
console.error(`Failed to load font file: ${resolved}\n${e}`)
5555
}
5656

57+
// Check if `font-family` is explicitly defined in `declarations`
58+
const hasCustomFontFamily = declarations?.some(
59+
({ prop }) => prop === 'font-family'
60+
)
61+
5762
// Get all values that should be added to the @font-face declaration
5863
const fontFaceProperties = [
5964
...(declarations
6065
? declarations.map(({ prop, value }) => [prop, value])
6166
: []),
62-
['font-family', variableName],
67+
...(hasCustomFontFamily ? [] : [['font-family', variableName]]),
6368
['src', `url(${fontUrl}) format('${format}')`],
6469
['font-display', display],
6570
...(weight ?? defaultWeight

0 commit comments

Comments
 (0)
0