Commit graph

47 commits

Author SHA1 Message Date
JJ Kasper
c204552ce2
v12.3.2-canary.33 2022-10-21 23:57:02 -07:00
Hannes Bornö
7796b1e50c
Font loader default config (#41628)
Adds default config if @next/font is a dependency. Warns instead of
errors when subsets is missing.

[slack
ref](https://vercel.slack.com/archives/C03KED0D4N7/p1666226599615489?thread_ts=1666225686.389179&cid=C03KED0D4N7)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-21 18:08:37 -07:00
Janicklas Ralph
56b097a8fb
Updating size-adjust calculation (#41406)
<!--
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 that you're making:




## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-->

Updating size-adjust calc to use azAvgWidth instead of xAvgCharWidth

Co-authored-by: Hannes Bornö <hannes.borno@vercel.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-20 10:58:26 -07:00
Hannes Bornö
77ba4a867a
Font loader types (#41591)
Make local and google font loaders more similar. Both should define `weight: string` and `style: string`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-20 17:42:19 +00:00
Tim Neutkens
d27185bb9a v12.3.2-canary.32 2022-10-19 13:29:32 +02:00
Jiachi Liu
2d1f72995b v12.3.2-canary.31 2022-10-18 21:19:01 -07:00
JJ Kasper
cf1c0b6075
v12.3.2-canary.30 2022-10-18 09:54:31 -07:00
Tim Neutkens
bc3d8be4ee v12.3.2-canary.29 2022-10-16 11:49:30 +02:00
JJ Kasper
560e93ef77
v12.3.2-canary.28 2022-10-13 15:30:56 -07:00
Tim Neutkens
4ff348cbd4 v12.3.2-canary.27 2022-10-13 15:13:48 +02:00
JJ Kasper
629fa8afa3
v12.3.2-canary.26 2022-10-12 08:45:51 -07:00
JJ Kasper
5162b64c21
v12.3.2-canary.25 2022-10-11 14:28:59 -07:00
Hannes Bornö
66a3028a3b
Reduce remote requests in google fonts (#41306)
Reduce remote request by reusing response between server and client
compilation. Once reused it can be removed, will be cached by webpack
after that.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-11 13:38:29 -07:00
Hannes Bornö
310b99902f
Reduce local font loader options (#41332)
Reduces the amount of options for local fonts. Adds additional regression tests.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-11 19:52:10 +00:00
JJ Kasper
3c8727dcab
v12.3.2-canary.24 2022-10-10 17:05:15 -07:00
Hannes Bornö
05498a0988
Local font files adjust fallbacks (#41180)
When using `@next/font/local` we can't have pre calculated metrics for the font. This PR uses fontkit to read metadata about the imported local font in order to generate a fallback.

Also removes some props from the api that's better done automatically in the future.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-10 18:54:34 +00:00
Tim Neutkens
52a69e6117 v12.3.2-canary.23 2022-10-08 19:11:53 +02:00
Hannes Bornö
b5590022b6
Font loaders next config shape (#41219)
Changes how font loaders are configured in next config, makes more sense since options can be optional. Also adds error for when font loaders are used from within node_modules.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-07 09:15:57 +00:00
Tim Neutkens
5e25bd2141 v12.3.2-canary.22 2022-10-06 21:44:28 +02:00
JJ Kasper
e8c760f7d4
v12.3.2-canary.21 2022-10-05 22:20:38 -07:00
Tim Neutkens
45bed96714 v12.3.2-canary.20 2022-10-05 16:35:59 +02:00
JJ Kasper
0d5886f20b
v12.3.2-canary.19 2022-10-04 10:15:01 -07:00
JJ Kasper
b56c039ef2
v12.3.2-canary.18 2022-10-03 17:57:44 -07:00
Tim Neutkens
cf9137a531 v12.3.2-canary.17 2022-10-02 21:08:24 +02:00
Hannes Bornö
fa96d870aa
Accept variable prop in google font loader (#41065)
Fixes local weight type which could break if you wrote "regular" instead of 400. Adds `variable` property to google font loader to let you define the name of the CSS variable.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-30 18:53:50 +00:00
Tim Neutkens
304730e6d5 v12.3.2-canary.16 2022-09-30 15:17:36 +02:00
Tim Neutkens
b4e53b796b v12.3.2-canary.15 2022-09-29 20:14:29 +02:00
Tim Neutkens
c889b31222 v12.3.2-canary.14 2022-09-29 13:26:46 +02:00
JJ Kasper
c1c95bfd31
v12.3.2-canary.13 2022-09-28 23:18:47 -07:00
Hannes Bornö
299f392d7b
Add support for fallback font and css variable for font/local (#40990)
Adds support for generating a fallback font by providing font override
metrics for the given local font. Also adds support for providing a CSS
variable name that then can be accessed through the `.variable` export,
it contains the hashed font family name.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-28 12:19:52 -07:00
Tim Neutkens
ebf2b298cb v12.3.2-canary.12 2022-09-28 17:56:44 +02:00
Jiachi Liu
918b109d76 v12.3.2-canary.11 2022-09-28 00:38:10 +02:00
Hannes Bornö
f53f5815f2
Font loader support in app (#40898)
Makes sure font loader CSS ends up correctly in the Flight Manifest and Flight Client Entries.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 18:10:05 +00:00
JJ Kasper
83c25b74d6
v12.3.2-canary.10 2022-09-26 23:31:23 -07:00
Tim Neutkens
6ceda2a3a2 v12.3.2-canary.9 2022-09-26 16:57:56 +02:00
Tim Neutkens
7ccc95c525 v12.3.2-canary.8 2022-09-26 15:52:34 +02:00
JJ Kasper
5d9f390fe4
v12.3.2-canary.7 2022-09-22 19:50:38 -07:00
JJ Kasper
f19241bf33
Update publish to skip private package (#40822)
Follow-up to https://github.com/vercel/next.js/pull/40815 ensures we
skip attempting to publish private packages like `next-swc`

x-ref:
https://github.com/vercel/next.js/actions/runs/3109438515/jobs/5039954716
2022-09-22 17:49:44 -07:00
JJ Kasper
8e1256d024
v12.3.2-canary.6 2022-09-22 16:33:46 -07:00
JJ Kasper
66ca4c21eb
v12.3.2-canary.5 2022-09-22 14:04:50 -07:00
JJ Kasper
24f2c53025
v12.3.2-canary.4 2022-09-22 12:53:58 -07:00
Hannes Bornö
75bbf00a8f
Add local font loader (#40801)
Moves font related types to `next/font` so they can be reused in font
loaders.

Adds an argument to font loaders, the relative path from the app root to
the module consuming the loader. Needed for resolving local files
relative to the module calling it. Also used to improve error message.

Adds `@next/font/local` font loader. Similar to `@next/font/google` but
used to host locally downloaded font files.
2022-09-22 12:49:02 -07:00
JJ Kasper
cc1e35d821
v12.3.2-canary.3 2022-09-21 22:51:10 -07:00
JJ Kasper
c2487ce262
v12.3.2-canary.2 2022-09-21 17:21:58 -07:00
JJ Kasper
48264c263a
Update publish to scope as public for initializing (#40778)
New scoped packages need to be initialized as public so this adds the
`publishConfig` for this.

Fixes:
https://github.com/vercel/next.js/actions/runs/3101494786/jobs/5023375720
2022-09-21 16:32:49 -07:00
JJ Kasper
4607140a7f
v12.3.2-canary.1 2022-09-21 15:20:12 -07:00
Hannes Bornö
1264196897
Add next font package (#40227)
For some context:
https://vercel.slack.com/archives/CGU8HUTUH/p1662124179102509

Adds `@next/font` package.

`scripts/update-google-fonts.js` generates functions and metadata for
all available google fonts. The metadata is used in `loader.ts` to
validate font options (from #40221). It then fetches the CSS from google
fonts, downloads the font files and emits them as static assets.

The actual integration with `packages/next` and integration tests
depends on #40221, will follow up with new PR.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-21 15:10:24 -07:00