Skip to content

Commit

Permalink
Merge branch 'chore/edge-runtime-cookies' of github.com:vercel/next.j…
Browse files Browse the repository at this point in the history
…s into chore/edge-runtime-cookies
  • Loading branch information
balazsorban44 committed Nov 11, 2022
2 parents 66ff4a7 + 2f149f2 commit 1df3417
Show file tree
Hide file tree
Showing 104 changed files with 8,580 additions and 4,739 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test_deploy.yml
Expand Up @@ -9,7 +9,7 @@ name: Build, test, and deploy
env:
NAPI_CLI_VERSION: 2.12.0
TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-09-23
RUST_TOOLCHAIN: nightly-2022-11-04
PNPM_VERSION: 7.3.0

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_stats.yml
Expand Up @@ -7,7 +7,7 @@ name: Generate Pull Request Stats
env:
NAPI_CLI_VERSION: 2.12.0
TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-09-23
RUST_TOOLCHAIN: nightly-2022-11-04
PNPM_VERSION: 7.3.0

jobs:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
profile: minimal
toolchain: nightly-2022-09-23
toolchain: nightly-2022-11-04

- name: Cache cargo registry
uses: actions/cache@v1
Expand Down
14 changes: 12 additions & 2 deletions docs/advanced-features/compiler.md
Expand Up @@ -233,13 +233,23 @@ module.exports = {
// The format is defined via string where variable parts are enclosed in square brackets [].
// For example labelFormat: "my-classname--[local]", where [local] will be replaced with the name of the variable the result is assigned to.
labelFormat?: string,
// default is undefined.
// This option allows you to tell the compiler what imports it should
// look at to determine what it should transform so if you re-export
// Emotion's exports, you can still use transforms.
importMap?: {
[packageName: string]: {
[exportName: string]: {
canonicalImport?: [string, string],
styledBaseImport?: [string, string],
}
}
},
},
},
}
```

Only `importMap` in `@emotion/babel-plugin` is not supported for now.

### Minification

Next.js' swc compiler is used for minification by default since v13. This is 7x faster than Terser.
Expand Down
169 changes: 92 additions & 77 deletions docs/api-reference/next/font.md

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions docs/basic-features/font-optimization.md
Expand Up @@ -158,6 +158,51 @@ export default function MyApp({ Component, pageProps }) {

View the [Font API Reference](/docs/api-reference/next/font.md#nextfontlocal) for more information.

## With Tailwind CSS

`@next/font` can be used with Tailwind CSS through a [CSS variable](/docs/api-reference/next/font#css-variables).

In the example below, we use the font `Inter` from `@next/font/google` (You can use any font from Google or Local Fonts). Load your font with the `variable` option to define your CSS variable name and assign it to `inter`. Then, use `inter.variable` to add the CSS variable to your HTML document.

```js
// pages/_app.js
import { Inter } from '@next/font/google'

const inter = Inter({
variable: '--font-inter',
})

export default function MyApp({ Component, pageProps }) {
return (
<main className={inter.variable}>
<Component {...pageProps} />
</main>
)
}
```

Finally, add the CSS variable to your [Tailwind CSS config](https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss):

```js
// tailwind.config.js
const { fontFamily } = require('tailwindcss/defaultTheme')

/** @type {import('tailwindcss').Config} \*/
module.exports = {
content: ['./app/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
fontFamily: {
sans: ['var(--font-inter)', ...fontFamily.sans],
},
},
},
plugins: [],
}
```

You can now use the `font-sans` utility class to apply the font to your elements.

## Preloading

When a font function is called on a page of your site, it is not globally available and preloaded on all routes. Rather, the font is only preloaded on the related route/s based on the type of file where it is used:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.0.3-canary.3"
"version": "13.0.3"
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -90,6 +90,7 @@
"@typescript-eslint/eslint-plugin": "4.29.1",
"@typescript-eslint/parser": "4.29.1",
"@vercel/fetch": "6.1.1",
"@vercel/og": "0.0.20",
"@webassemblyjs/ast": "1.11.1",
"@webassemblyjs/floating-point-hex-parser": "1.11.1",
"@webassemblyjs/helper-api-error": "1.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.0.3-canary.3",
"version": "13.0.3",
"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.0.3-canary.3",
"version": "13.0.3",
"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.0.3-canary.3",
"@next/eslint-plugin-next": "13.0.3",
"@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.0.3-canary.3",
"version": "13.0.3",
"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.0.3-canary.3",
"version": "13.0.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
127 changes: 120 additions & 7 deletions packages/font/src/google/font-data.json
Expand Up @@ -1574,6 +1574,12 @@
],
"styles": ["normal"],
"axes": [
{
"tag": "slnt",
"min": -11,
"max": 11,
"defaultValue": 0
},
{
"tag": "wght",
"min": 200,
Expand Down Expand Up @@ -2760,6 +2766,10 @@
"weights": ["400"],
"styles": ["normal"]
},
"Fragment Mono": {
"weights": ["400"],
"styles": ["normal", "italic"]
},
"Francois One": {
"weights": ["400"],
"styles": ["normal"]
Expand Down Expand Up @@ -3449,6 +3459,10 @@
"weights": ["100", "200", "300", "400", "500", "600", "700"],
"styles": ["normal"]
},
"IBM Plex Sans JP": {
"weights": ["100", "200", "300", "400", "500", "600", "700"],
"styles": ["normal"]
},
"IBM Plex Sans KR": {
"weights": ["100", "200", "300", "400", "500", "600", "700"],
"styles": ["normal"]
Expand Down Expand Up @@ -4780,6 +4794,18 @@
"weights": ["400"],
"styles": ["normal"]
},
"Marhey": {
"weights": ["300", "400", "500", "600", "700", "variable"],
"styles": ["normal"],
"axes": [
{
"tag": "wght",
"min": 300,
"max": 700,
"defaultValue": 400
}
]
},
"Markazi Text": {
"weights": ["400", "500", "600", "700", "variable"],
"styles": ["normal"],
Expand Down Expand Up @@ -4869,8 +4895,16 @@
"styles": ["normal"]
},
"Merienda": {
"weights": ["400", "700"],
"styles": ["normal"]
"weights": ["300", "400", "500", "600", "700", "800", "900", "variable"],
"styles": ["normal"],
"axes": [
{
"tag": "wght",
"min": 300,
"max": 900,
"defaultValue": 400
}
]
},
"Merienda One": {
"weights": ["400"],
Expand Down Expand Up @@ -5547,8 +5581,16 @@
]
},
"Noto Sans Bassa Vah": {
"weights": ["400"],
"styles": ["normal"]
"weights": ["400", "500", "600", "700", "variable"],
"styles": ["normal"],
"axes": [
{
"tag": "wght",
"min": 400,
"max": 700,
"defaultValue": 400
}
]
},
"Noto Sans Batak": {
"weights": ["400"],
Expand Down Expand Up @@ -6106,6 +6148,35 @@
}
]
},
"Noto Sans Lao Looped": {
"weights": [
"100",
"200",
"300",
"400",
"500",
"600",
"700",
"800",
"900",
"variable"
],
"styles": ["normal"],
"axes": [
{
"tag": "wdth",
"min": 62.5,
"max": 100,
"defaultValue": 100
},
{
"tag": "wght",
"min": 100,
"max": 900,
"defaultValue": 400
}
]
},
"Noto Sans Lepcha": {
"weights": ["400"],
"styles": ["normal"]
Expand Down Expand Up @@ -6234,6 +6305,10 @@
}
]
},
"Noto Sans Mende Kikakui": {
"weights": ["400"],
"styles": ["normal"]
},
"Noto Sans Meroitic": {
"weights": ["400"],
"styles": ["normal"]
Expand Down Expand Up @@ -6300,8 +6375,16 @@
"styles": ["normal"]
},
"Noto Sans New Tai Lue": {
"weights": ["400"],
"styles": ["normal"]
"weights": ["400", "500", "600", "700", "variable"],
"styles": ["normal"],
"axes": [
{
"tag": "wght",
"min": 400,
"max": 700,
"defaultValue": 400
}
]
},
"Noto Sans Newa": {
"weights": ["400"],
Expand Down Expand Up @@ -7153,6 +7236,18 @@
}
]
},
"Noto Serif Oriya": {
"weights": ["400", "500", "600", "700", "variable"],
"styles": ["normal"],
"axes": [
{
"tag": "wght",
"min": 400,
"max": 700,
"defaultValue": 400
}
]
},
"Noto Serif SC": {
"weights": ["200", "300", "400", "500", "600", "700", "900"],
"styles": ["normal"]
Expand Down Expand Up @@ -8996,6 +9091,24 @@
"weights": ["400"],
"styles": ["normal"]
},
"Sono": {
"weights": ["200", "300", "400", "500", "600", "700", "800", "variable"],
"styles": ["normal"],
"axes": [
{
"tag": "MONO",
"min": 0,
"max": 1,
"defaultValue": 1
},
{
"tag": "wght",
"min": 200,
"max": 800,
"defaultValue": 400
}
]
},
"Sonsie One": {
"weights": ["400"],
"styles": ["normal"]
Expand Down Expand Up @@ -9985,7 +10098,7 @@
"styles": ["normal"]
},
"Zen Old Mincho": {
"weights": ["400", "700", "900"],
"weights": ["400", "500", "600", "700", "900"],
"styles": ["normal"]
},
"Zen Tokyo Zoo": {
Expand Down

0 comments on commit 1df3417

Please sign in to comment.