- 14 Jun, 2022 3 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
* Ensure custom middleware matcher is used correctly in client manifest * lint-fix * patch e2e case * fix rsc case * update test * add missing normalize
-
Michael Novotny authored
* Adds consistency to ESLint rules. * Fixes lint errors. * Fixes manifest. * Adds missing title. * Fixes copy / paste error. Co-authored-by:
Lee Robinson <me@leerob.io> * Update errors/no-script-in-document.md Co-authored-by:
Lee Robinson <me@leerob.io> * Update errors/no-sync-scripts.md Co-authored-by:
Lee Robinson <me@leerob.io> * Updates a couple of rule descriptions. * Adds redirects. * Fixes unit tests. * Removes duplicated section. * Updates `no-before-interactive-script-outside-document` description. * Fixes lint. * Fixes integration tests. * Adds description to `no-before-interactive-script-outside-document` documentation. * Removes `link-passhref` from rules list. * Updates remaining `pages/_middleware.js` references. * Adds consistancy to messaging in new `no-styled-jsx-in-document` rule. * Apply suggestions from code review * Apply suggestions from code review Co-authored-by:
Lee Robinson <me@leerob.io> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl> Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
- 13 Jun, 2022 14 commits
-
-
Steven authored
In a previous PR (#34075), the ISR behavior was introduced to the Image Optimization API, however it changed the cache-control header to always set maxage=0. While this is probably the right behavior (the client shouldn't cache the image), it introduced a regression for users who have CDNs in front of a single Next.js instance (as opposed to [multiple Next.js instances](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration#self-hosting-isr)). Furthermore, the pros of client-side caching outweight the cons because its easy to change the image url (add querystring param for example) to invalidate the cache. This PR reverts the cache-control behavior until we can come up with a better long-term solution. - Fixes #35987 - Related to #19914 - Related to #22319 - Closes #35596
-
JJ Kasper authored
-
JJ Kasper authored
-
JJ Kasper authored
* Allow passing FileRef directly to createNext * update type
-
Gal Schlezinger authored
* Re-introduce Edge API Endpoints This reverts commit 210fa399, and re-introduces Edge API endpoints as a possible runtime selection in API endpoints. This is done by exporting a `config` object: ```ts export config = { runtime: 'edge' } ``` Note: `'edge'` will probably change into `'experimental-edge'` to show that this is experimental and the API might change in the future. * Support `experimental-edge`, but allow `edge` too Co-authored-by:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
JJ Kasper authored
-
Splatterxl authored
-
Thuy Doan authored
* Update upchunk to latest (2.3.1). * Add mux-player package to package.json * WIP: Make VideoPlayer return mux-player * Remove unused code from prev video player * Use mux-player-react directly * Fix import line for mux-player-react * chore: fix lint issues
-
JJ Kasper authored
-
JJ Kasper authored
This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next.js/pull/37574 ## Bug - [ ] Related issues linked using `fixes #number` - [x] 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)
-
Adam Sobotka authored
In my last PR I removed the request library as it is obsolete and the application does not use it. The database setup utility does though, so I am reverting this change. Co-authored-by:JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Houssein Djirdeh authored
[Recent changes](https://github.com/vercel/next.js/pull/31936) to `next/script` introduced the capability to use `beforeInteractive` scripts in the custom document. This old error message is incorrect.
-
Adam Sobotka authored
This is just a bump of tech stack used in the example and small rewrite of swr functionality. ## 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` - [ x ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Joe Previte authored
This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Errors have helpful link attached, see `contributing.md`  ## To run locally 1. `pnpm build` 2. `pnpm testonly test/integration/export-getInitialProps-warn/test/index.test.js` Fixes #13946 ## Notes <details> <summary>Click to toggle see</summary> I know the `contributing.md` doc said to avoid adding new tests to `integration`. It also said new tests should be written in TypeScript. I wasn't sure where to put the tests for this so I went with `integration`. I also didn't see many other tests written in TS in this part of the codebase so I stuck with `.js`. </details> Co-authored-by:
JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
- 11 Jun, 2022 4 commits
-
-
You Nguyen authored
-
Alabhya Jindal authored
Changed the class component to a functional component of the _app.js file. This is for the Context API example.
-
Damien Simonin Feugas authored
* chore: narrows regexp to enable middleware source maps * update test Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Joseph authored
* fix: On error upchunk dispatches an object * chore: Typo on contribution guide, `unverfied` * Update contributing.md Co-authored-by:
Lee Robinson <me@leerob.io> Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
- 10 Jun, 2022 8 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
* Update usage of example.com -> example.vercel.sh * another one * another flakey test
-
JJ Kasper authored
* update android ndk path * re-add isRelease checks
-
JJ Kasper authored
-
Jiachi Liu authored
Strip next internal queries in inline flight response ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
-
Hannes Bornö authored
* Add regression tests for locale prefixed public files * Add tests for ignoring source locale in rewrite * Fix lint * Add doc example * Redirect tests * fix test names * update tests Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Steven authored
* 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>
-
JJ Kasper authored
* 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
-
- 09 Jun, 2022 6 commits
-
-
Shu Ding authored
Reverts vercel/next.js#37572, with a new test case added about `routeChangeComplete`.
-
JJ Kasper authored
* Ensure check-precompiled exits correctly on failure * update compiled
-
Shu Ding authored
fix client entry unexpectedly created
-
Jiachi Liu authored
* Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
-
Gal Schlezinger authored
This commit enables the following patterns in Middleware: ```ts // with a dot notation const { ENV_VAR, "ENV-VAR": myEnvVar } = process.env; // or with an object access const { ENV_VAR2, "ENV-VAR2": myEnvVar2 } = process["env"]; ``` ### Related - @cramforce asked this fixed here: https://github.com/vercel/next.js/pull/37514#discussion_r892437257 ## Feature - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [x] 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` -
Kiko Beats authored
This PR moves the internal logic associated with `req.ua` into an explicit method the user should to call to have the same behavior. **before** ```typescript // middleware.ts import { NextRequest, NextResponse } from 'next/server' export function middleware(request: NextRequest) { const url = request.nextUrl const viewport = request.ua.device.type === 'mobile' ? 'mobile' : 'desktop' url.searchParams.set('viewport', viewport) return NextResponse.rewrites(url) } ``` **after** ```typescript // middleware.ts import { NextRequest, NextResponse, userAgent } from 'next/server' export function middleware(request: NextRequest) { const url = request.nextUrl const { device } = userAgent(request) const viewport = device.type === 'mobile' ? 'mobile' : 'desktop' url.searchParams.set('viewport', viewport) return NextResponse.rewrites(url) } ``` This potentially will save the extra 17 kB related to the size of `ua-parser-js`
-
- 08 Jun, 2022 5 commits
-
-
JJ Kasper authored
-
Shu Ding authored
Reverts vercel/next.js#37431
-
Lee Robinson authored
This PR adds new information to the Next.js deployment documentation to highlight examples or guides for deploying Next.js to a handful of services. This builds on the existing documentation around the Next.js Build API (from `next build`) and options for self-hosting with Node.js or Docker. ## 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 - [x] 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 `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
JJ Kasper authored
-
Damien Simonin Feugas authored
* chore: reworks nested middleware error message * chore: fix invalid path in nested middleware error message * Update to show nested middleware error together * update Co-authored-by:JJ Kasper <jj@jjsweb.site>
-