Commit graph

34 commits

Author SHA1 Message Date
JJ Kasper
07420998c1
v12.1.7-canary.36 2022-06-13 10:32:27 -05:00
JJ Kasper
1463f0d1bc
v12.1.7-canary.35 2022-06-10 18:24:42 -05:00
JJ Kasper
f8ebb19dc5
v12.1.7-canary.34 2022-06-10 15:23:31 -05:00
Steven
2addf464d2
Bump @vercel/nft 0.20.0 (#37602)
* Bump @vercel/nft 0.20.0

* Filter out wasm files

* Revert filter that is no longer needed

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-06-10 13:10:52 -05:00
JJ Kasper
607ff2b322
Update to process redirects/rewrites for _next/data with middleware (#37574)
* Update to process redirects/rewrites for _next/data

* correct matched-path resolving with middleware

* Add next-data header

* migrate middleware tests

* lint-fix

* update error case

* update test case

* Handle additional resolving cases and add more tests

* update test from merge

* fix test

* rm .only

* apply changes from review

* ensure _next/data resolving does not apply without middleware
2022-06-10 12:35:12 -05:00
JJ Kasper
0c986cd767
v12.1.7-canary.33 2022-06-08 16:55:45 -05:00
JJ Kasper
2ea3e92a21
v12.1.7-canary.32 2022-06-08 11:55:39 -05:00
Javi Velasco
7584b02b34
Remove Middleware Preflight (#37490)
* Refactor data fetching to support getting headers

* Relax `getNextPathnameInfo` type

* Add test for middleware internal redirects

* Export `ParsedRelativeUrl` type

* Refactor `getMiddlewareEffects`

* Move rewrite i18n test to middleware rewrite tests

* Fix bug parsing pathname info

* Normalize data requests to page requests for middleware

* Ensure there is a header `x-nextjs-matched-path` for middleware rewrites on data requests

* Extract `getDataHref` to a function

* Stop using `getDataHref` for flight

* Always set the query in `dataHref` independently of if it is SSG

* Add test for recursive rewrites

* Refactor dynamicPath validation to `matchHrefAndAsPath`

* Add `dataHref` to `FetchDataOutput`

* Extract `matchesMiddleware` function

* Add `hasMiddleware` option to `fetchNextData`

* Move preflight test

* Remove preflight test

* Add middleware prefetch tests

* Remove preflight

* Attempt to reduce bundle size

Include `withMiddlewareEffects` and `matchHrefAndAsPath` into `router`

Bring `getDataHref` back to `page-loader`

Bring `resolveDynamicRoute` back to `router`

* Reduce arg duplication for `withMiddlewareEffects`

* Remove some async/await and spreads to reduce bundle size

* Upgrade `edge-runtime` & clone `Request` on redirects to mutate headers

* Add some rewrite tests

Co-authored-by: Kiko Beats <josefrancisco.verdu@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-06-08 10:41:28 -05:00
JJ Kasper
01ecff3b09
Update to latest version of @swc/helpers (#37531)
* Update to latest version of @swc/helpers

* update lock
2022-06-08 11:52:26 +02:00
Keen Yee Liau
dc36199b22
add method to measure Interaction to Next Paint (INP) (#36490)
This commit lets users measure their Interaction to Next Paint [INP](https://web.dev/inp/) web vital.
Note that the `web-vitals` package is beta to denote that INP is an experimental metric, the code is stable and v3 is backwards compatible.

    `web-vitals` CHANGELOG for v3:
    
    - [BREAKING] Report TTFB after a bfcache restore
    - [BREAKING] Only include last LCP entry in metric entries
    - Add support for the new INP metric
    - Rename getXXX() functions to onXXX()
    - Add a navigationType property to the Metric object
    
    See https://github.com/GoogleChrome/web-vitals/blob/next/CHANGELOG.md

Upgraded `playwright-chromium` from `1.14.1` to `1.17.2` because the Events Timing API used to measure INP is only available in Chromium >= v98.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-06-07 18:28:58 +00:00
JJ Kasper
ff0ccc4817
Enable externalHelpers swc option (#37150)
* Enable externalHelpers swc option

* disable with pnp
2022-06-07 10:59:05 -05:00
Keen Yee Liau
1fcf21c7e7
test: upgrade playwright-chromium from 1.14.1 to 1.22.2 (#37436)
* test: upgrade playwright-chromium from 1.14.1 to 1.22.2

This is a prereq for #36490 because the Events Timing API
used to measure Interaction to Next Paint (INP, experiemental web vital)
is only available in Chromium >= v98.

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-06-06 23:37:01 -05:00
JJ Kasper
6f2eb24109
v12.1.7-canary.31 2022-06-06 16:49:30 -05:00
JJ Kasper
28a56d8220
v12.1.7-canary.30 2022-06-06 14:39:08 -05:00
Shu Ding
f56a3de49e
Upgrade node-html-parser (#37449)
* upgrade node-html-parser

* update define bundle patching

* update compiled

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-06-06 15:36:29 -04:00
Gal Schlezinger
401a9a4479
Allow Middleware to set its matcher (#37177)
This PR will allow Middleware to set its matcher through `export const config = { matching: ... }`

## Related

* This PR is rebased off #37121 

## 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 helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-06-03 16:35:44 +00:00
Shu Ding
a3e067e6e5
Use the new moduleMap option in the flight client during SSR (#37406)
Adopt the new `moduleMap` option added in https://github.com/facebook/react/pull/24629, which helps us getting rid of our hacky implementation injected to `globalThis.__next_require__`. The map will be attached to the flight manifest as `__ssr_module_mapping__`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 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.md#adding-examples)
2022-06-02 15:43:25 +00:00
Tim Neutkens
20f9e949b0 v12.1.7-canary.29 2022-06-02 16:02:47 +02:00
Tobias Koppers
273da9e118
update webpack and watchpack (#37397)
https://github.com/webpack/watchpack/releases/tag/v2.4.0
https://github.com/webpack/webpack/releases/tag/v5.73.0

and let pnpm clean up some stuff
2022-06-02 13:09:21 +00:00
Tim Neutkens
ebc3408f47 v12.1.7-canary.28 2022-06-02 12:03:17 +02:00
Tim Neutkens
c31c95b735 v12.1.7-canary.27 2022-06-01 13:54:05 +02:00
JJ Kasper
d153f0db28
v12.1.7-canary.26 2022-05-31 11:39:07 -05:00
7iomka
7b91a1c156
Update of @babel/core (#37145)
Update of @babel/core to fix Type-only import specifiers issue


Fixes [#37016](https://github.com/vercel/next.js/issues/37016)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-31 01:00:12 +00:00
JJ Kasper
1d1ffc88b7
Update to leverage turbo for build/prepublish (#37280)
* Update to leverage turbo for build/prepublish

* update path

* remove extra turbo config
2022-05-30 19:05:27 -05:00
Tim Neutkens
67180687f4 v12.1.7-canary.25 2022-05-30 20:25:01 +02:00
Tim Neutkens
96cabcdede v12.1.7-canary.24 2022-05-30 15:16:47 +02:00
Kiko Beats
6ebe0fa0cd
declare pnpm7 as engine (#37303)
Ensure to use npm v7, otherwise the lockfile will be messed with previous versions

Related: https://pnpm.io/npmrc#lockfile
2022-05-30 13:13:36 +00:00
Kiko Beats
fafbea8b74
Use Edge Runtime for running Edge Functions locally (#37024)
This PR introduces [Edge Runtime](https://edge-runtime.vercel.app/) for emulating [Edge Functions](https://vercel.com/features/edge-functions) locally.

Every time you run a [middleware](https://nextjs.org/docs/advanced-features/middleware) locally via `next dev`, an isolated edge runtime context will be created.

These contexts have the same constraints as production servers, plus they don't pollute the global scope; Instead, all the code run in a vm on top of a Node.js process.

Additionally, `@edge-runtime/jest-environment` has been added to make easier testing Edge Functions in a programmatic way.

It dropped the following polyfills from Next.js codebase, since they are now part of Edge Runtime:

- abort-controller
- formdata
- uuid
- web-crypto
- web-streams

Co-authored-by: Gal Schlezinger <2054772+Schniz@users.noreply.github.com>
2022-05-30 12:01:36 +00:00
JJ Kasper
ec572b0bb8
v12.1.7-canary.23 2022-05-29 19:56:31 -05:00
Sebastian Benz
bbe8a9e191
Upgrade amp optimizer to v2.8.3 (#27106)
* upgrade amp optimizer to v2.8.3

* update lock

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-05-29 19:38:23 -05:00
JJ Kasper
db805ced22
v12.1.7-canary.22 2022-05-29 17:21:20 -05:00
JJ Kasper
23013674a1
v12.1.7-canary.21 2022-05-29 15:00:22 -05:00
Remco Haszing
a7eb6695aa
Add type definitions for next/mdx (#36815)
Although it’s not intended for use in TypeScript, TypeScript still offers some nice features when it’s used in next.config.js (completion, hovers, `"checkJs": true`).

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-29 05:21:25 +00:00
JJ Kasper
f7b81316ae
Update to leverage pnpm for monorepo (#37259)
* Update to leverage pnpm for monorepo

* update compiled

* update stats action

* update ci install step

* update ci

* add test dep

* update invoking scripts

* update caching

* skip cache for now

* update dep

* update packages and fix babel

* update compiled

* update lint

* update test

* update ci

* update pnpm store caching

* update path for windows

* update restore-key config

* update caching

* remove extra build azure stage

* re-add checkout

* update setting pnpm store

* bump

* remove azure caching as pnpm is faster to download

* update contributing

* apply suggestions

* remove install-peers

* prepublish -> prepublishOnly

* prepublish -> prepublishOnly more

* more yarn -> pnpm references

* more yarn -> pnpm references take 2

* use workspace protocol for root package.json

Co-authored-by: Steven <steven@ceriously.com>
2022-05-28 23:35:16 -05:00