- 06 Feb, 2024 19 commits
-
-
vercel-release-bot authored
-
Steven authored
## History Previously, we added support for `squoosh` because it was a wasm implementation that "just worked" on all platforms when running `next dev` for the first time. However, it was slow so we always recommended manually installing `sharp` for production use cases running `next build` and `next start`. Now that [`sharp` supports webassembly](https://sharp.pixelplumbing.com/install#webassembly), we no longer need to maintain `squoosh`, so it can be removed. We also don't need to make the user install sharp manually because it can be installed under `optionalDependencies`. I left it optional in case there was some platform that still needed to manually install the wasm variant with `npm install --cpu=wasm32 sharp` such as codesandbox/stackblitz (I don't believe sharp has any fallback built in yet). Since we can guarantee `sharp`, we can also remove `get-orientation` dep and upgrade `image-size` dep. I also moved an [existing `sharp` test](https://github.com/vercel/next.js/pull/56674) into its own fixture since it was unrelated to image optimization. ## Related Issues - Fixes https://github.com/vercel/next.js/issues/41417 - Closes https://github.com/vercel/next.js/pull/54670 - Related https://github.com/vercel/next.js/issues/54708 - Related https://github.com/vercel/next.js/issues/44804 - Related https://github.com/vercel/next.js/issues/48820
-
Will Binns-Smith authored
- parsed stack traces (and error stack locations in js) have 1-based lines and 1-based columns - source map tokens have 0-based lines and 0-based columns - babel code frames use 1-based lines and 0-based columns This was not always respected. This preserves the 1-based lines and columns in anything called a stack frame, 0-based lines and columns for source map apis, and converts to babel’s format as needed. Closes PACK-2341 --------- Co-authored-by:Tobias Koppers <tobias.koppers@googlemail.com>
-
JJ Kasper authored
Our tag values are case-sensitive so this ensures we properly document this so users are aware of this caveat. x-ref: https://github.com/vercel/next.js/pull/61392#issuecomment-1926004777 Closes NEXT-2379
-
OJ Kwon authored
<!-- 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(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### How? Closes NEXT- Fixes # --> ### What? This PR introduces a ground work to generate wasm bindings package from our napi bindings. This doesn't actually replace anything yet, however aim to establish our napi bindings package can be built against wasm32 target. ### Why? We currently have two bindings package to generate native / wasm target support, one for napi and one other for wasm. Recently napi-rs started to support to generate bindings for the wasm directly - which means we can get rid of the wasm-pack based bindings code entirely and maintain a single bindings code only. This'll makes our `next-swc` simpler as well, since the invocation to the bindings now becomes identical we don't have to additional wasm specific logics to invoke functions (i.e transform, transformsync..). Also napi generates wasi-supported wasm bindings, provides few more features to the current wasm bindings. #### Good - Async napi binding fn works transparently (`transform`, `minify`...) - (Experimental) thread supports depends on node.js runtime - Wasi support: i.e it can even read filesystem directly! #### Things to consider - node.js's wasi support is experimental yet - napi-rs's wasm support is in beta yet, specifically `packaging` generated wasm output. Due to `things to consider` reasons, this PR does not replace existing wasm target yet. We should be able to plan out things later. **What happens to the turbopack api in napi bindings?** Simply put, this **does not support turbopack in wasm**. Build works by disabling turbopack (more notably, underlying dependency doesn't support wasm) features. It is something to explore separately. Closes PACK-2367 There is a branch at https://github.com/vercel/next.js/pull/61586 shows quick demo for importing, running sync / async / read external files.
-
Julius Marminge authored
This alters the behavior of the subrequest check to allow for 5 recursive calls to match Vercel production, ref [Slack thread](https://pinglabsworkspace.slack.com/archives/C052S77L05C/p1694729495655489). > [!NOTE] > Currently limited by fetches having to forward the subrequest header for each request which isn't ideal. Need some assistant on how to access the request in the module context fetch override. > No forwarding:  > With forwarding:  --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
OJ Kwon authored
### What? This PR wraps up supporting rsc transforms (mostly for the assertion) in Turbopack. PR contains a few changes to support it, including: - adjust / expand transform rules for the corresponding contexts - fix file name / node_modules check - extract visitors for the assertion / transforms This change enables most of the rsc-build* tests and some more other tests. The only failing tests in the rsc-build-errors is due to Turbopack not triggering hmr with empty file. Closes PACK-2303
-
vercel-release-bot authored
-
Jiachi Liu authored
### What & Why We have a modularize imports config for `next/server` before, which will transform the `next/server` imports to directly import from the actual file, for instance: `import { NextRequest } from 'next/server'` will become `import { NextRequest } from 'next/dist/server/web/exports/next-request'`, where the NextRequest is exported as default export. This is fine in most case until you're using a ESM pkg, then it will be resolved as `{ default: NextRequest }` according to the spec. Since it's a ESM import to a CJS module in `next/dist`. Since we already have the ESM alias introduced in #59852 , this can handle the case more properly. ### How Remove the modularize imports config for `next/server`, use the ESM api alias instead. Migrate the cjs optimizer tests from middleware to a separate endpoint `/cjs/server`. As now ESM imports for next/server are not going to get tree-shaken in dev, but since we don't have image response there it's still fine. Closes NEXT-2376 Closes NEXT-2374 -
Zack Tanner authored
### What When navigating to a page with dynamic params using a certain casing, and then following a link to another page using _different_ casing for the same param, the router would get stuck in an infinite suspense cycle. ### Why On the client we normalize cache keys by lowercasing the values for dynamic segments. However the RSC data for each segment wouldn't have this same casing logic applied. This is causing the router to not recognize that there is already RSC data available for that segment, resulting in an infinite suspense cycle. ### How The `toLowerCase()` logic shouldn't be needed here. Technically we could leave this in place and update `matchSegment` to also apply the lowercase logic, but currently there are too many utility functions that parse segments to comfortably make that change. I confirmed that the bug related to why we lowercased these router cache keys is no longer present after making this change. Fixes #61722 Closes NEXT-2377
-
Balázs Orbán authored
### What? Let the developer check the instance of `ReadonlyURLSearchParams` to match against `URLSearchParams` ### Why? `useSearchParams()`'s return type is `ReadonlyURLSearchParams` which implements all the methods of `URLSearchParams`, therefore its type should be extended from `URLSearchParams` as well. Deprecated methods are also implemented to throw an error, so no runtime behavior is being changed ### How? Mark the unavailable methods as `@deprecated` which will visually mark them in IDEs:  This is similar how `ReadonlyHeaders` extends `Headers`, added in: #49075 [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706628877916779) Closes NEXT-2305
-
Zack Tanner authored
### What Client-side transitioning to a page that triggered a loading boundary with async metadata would cause the transition to stall, potentially getting stuck in a refetch loop. ### Why In layout-router, we trigger a "lazy fetch" when we encounter a segment that we don't have cache nodes for. This calls out to the server and suspends until the data fetch is resolved, and applied to the router tree. However after suspending but before updating the client router, we set `childNode.lazyData` to null. When we unsuspend from the server patch action, `childNode.rsc` might still be missing and clearing `lazyData` means we've blown away the reference to the fetch we already had pending, triggering a refetch loop. ### How This removes the logic that mutates the cache node in render, as this is not concurrent safe, and doesn't appear to be needed for anything. Fixes #61117 Closes NEXT-2361 --------- Co-authored-by:Jiachi Liu <inbox@huozhi.im>
-
Vercel Release Bot authored
This auto-generated PR updates the integration test manifest used when testing Turbopack.
-
Leah authored
### Turbopack Updates * https://github.com/vercel/turbo/pull/7240 <!-- OJ Kwon - refactor(turbopack): remove deprecated options --> * https://github.com/vercel/turbo/pull/7241 <!-- Will Binns-Smith - Turbopack: Fix Next.js in cross-bundler benchmarks --> * https://github.com/vercel/turbo/pull/7274 <!-- Leah - fix(turbopack): support reloading typescript tailwind config --> Fixes #61607
-
Jiachi Liu authored
### What #### Core This PR respect the error's digest when recieves new error occurred from server side, and it will be logged into client on production with the same `digest` property. If we discover the original RSC error in SSR error handler, retrieve the original error #### Tests * Move the errors related tests from `test/e2e/app-dir/app` to a separate test suite `test/e2e/app-dir/errors` * Add a new test case for logging the original RSC error * Add a new test case for logging the original Server Action error ### Why This will help associate the `digest` property of the errors logged from client with the actual generated server errors. Previously they're different as we might re-compute the digest proper in handler that react server renderer thinks it's a new error, which causes we have 2 different errors logged on server side, and 1 logged on client side. The one on client side can associate to the server errors but it's from react renderer which is not the original error. Closes NEXT-2094 Fixes #60684
-
Tobias Koppers authored
### What? * decode magic identifiers when printing compile errors to the console * Error Overlay * decode magic identifiers in the error message * decode magic identifiers in source frame * decode magic identifiers in call stack    ### Why? ### How? PACK-2008 Closes PACK-2387
-
Tim Neutkens authored
## What? Updates the test checks for Turbopack. <!-- 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(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2364
-
Leah authored
### What? I forgot to check the `preload` option when implementing it and just looked at the `subsets`. This also fixes duplicate preload tags by adding them to a set in the default `_document.tsx` Closes PACK-2392
-
Josh Story authored
Updates React from 60a927d04 to 2bc7d336a Also updates aliases for `react.shared-subset` to `react.react-server` ### React upstream changes - https://github.com/facebook/react/pull/28250 - https://github.com/facebook/react/pull/28225 - https://github.com/facebook/react/pull/28123 - https://github.com/facebook/react/pull/28240 - https://github.com/facebook/react/pull/28239 - https://github.com/facebook/react/pull/28245 - https://github.com/facebook/react/pull/28244 - https://github.com/facebook/react/pull/28238 - https://github.com/facebook/react/pull/28235 - https://github.com/facebook/react/pull/28221 - https://github.com/facebook/react/pull/28215 - https://github.com/facebook/react/pull/28214 - https://github.com/facebook/react/pull/28213 - https://github.com/facebook/react/pull/28212 - https://github.com/facebook/react/pull/28211 - https://github.com/facebook/react/pull/28247 - https://github.com/facebook/react/pull/28210 - https://github.com/facebook/react/pull/28186 - https://github.com/facebook/react/pull/28232 - https://github.com/facebook/react/pull/28169 - https://github.com/facebook/react/pull/28177 - https://github.com/facebook/react/pull/28170 - https://github.com/facebook/react/pull/28168 - https://github.com/facebook/react/pull/28122 - https://github.com/facebook/react/pull/27982 - https://github.com/facebook/react/pull/28217 - https://github.com/facebook/react/pull/28223 - https://github.com/facebook/react/pull/28208 - https://github.com/facebook/react/pull/28209 - https://github.com/facebook/react/pull/28200 - https://github.com/facebook/react/pull/28199 - https://github.com/facebook/react/pull/28198 - https://github.com/facebook/react/pull/28197 - https://github.com/facebook/react/pull/28196 - https://github.com/facebook/react/pull/28194 - https://github.com/facebook/react/pull/28192 - https://github.com/facebook/react/pull/28191 - https://github.com/facebook/react/pull/28182 - https://github.com/facebook/react/pull/28181 - https://github.com/facebook/react/pull/28180 - https://github.com/facebook/react/pull/28178 - https://github.com/facebook/react/pull/28201 - https://github.com/facebook/react/pull/28176 - https://github.com/facebook/react/pull/28162 - https://github.com/facebook/react/pull/28131 - https://github.com/facebook/react/pull/28190 - https://github.com/facebook/react/pull/28172 - https://github.com/facebook/react/pull/28171 - https://github.com/facebook/react/pull/28173 - https://github.com/facebook/react/pull/28174 - https://github.com/facebook/react/pull/28175 - https://github.com/facebook/react/pull/28136 - https://github.com/facebook/react/pull/28135 - https://github.com/facebook/react/pull/28134 - https://github.com/facebook/react/pull/28133 - https://github.com/facebook/react/pull/28132 - https://github.com/facebook/react/pull/28130 - https://github.com/facebook/react/pull/28202 - https://github.com/facebook/react/pull/28102 - https://github.com/facebook/react/pull/28161 - https://github.com/facebook/react/pull/28193 - https://github.com/facebook/react/pull/28195 - https://github.com/facebook/react/pull/28189 - https://github.com/facebook/react/pull/28160 - https://github.com/facebook/react/pull/28096 - https://github.com/facebook/react/pull/28183 - https://github.com/facebook/react/pull/28125 - https://github.com/facebook/react/pull/28157 - https://github.com/facebook/react/pull/28115 - https://github.com/facebook/react/pull/28124 - https://github.com/facebook/react/pull/28163 - https://github.com/facebook/react/pull/28164 - https://github.com/facebook/react/pull/28150 - https://github.com/facebook/react/pull/28159 - https://github.com/facebook/react/pull/28069 - https://github.com/facebook/react/pull/28110 - https://github.com/facebook/react/pull/28148 - https://github.com/facebook/react/pull/28116 - https://github.com/facebook/react/pull/28099 - https://github.com/facebook/react/pull/28100 - https://github.com/facebook/react/pull/28147 - https://github.com/facebook/react/pull/28128 - https://github.com/facebook/react/pull/28126 - https://github.com/facebook/react/pull/28139 - https://github.com/facebook/react/pull/28140 - https://github.com/facebook/react/pull/28141 - https://github.com/facebook/react/pull/28142 - https://github.com/facebook/react/pull/28113 - https://github.com/facebook/react/pull/28129 - https://github.com/facebook/react/pull/28114 - https://github.com/facebook/react/pull/28053 - https://github.com/facebook/react/pull/28091 - https://github.com/facebook/react/pull/28087 - https://github.com/facebook/react/pull/28112 - https://github.com/facebook/react/pull/28086 - https://github.com/facebook/react/pull/28101 - https://github.com/facebook/react/pull/28106 - https://github.com/facebook/react/pull/28117 - https://github.com/facebook/react/pull/28118 - https://github.com/facebook/react/pull/28105 - https://github.com/facebook/react/pull/27883 - https://github.com/facebook/react/pull/28111 - https://github.com/facebook/react/pull/28095 - https://github.com/facebook/react/pull/28108 - https://github.com/facebook/react/pull/28090 - https://github.com/facebook/react/pull/28089 - https://github.com/facebook/react/pull/28076 - https://github.com/facebook/react/pull/28074 - https://github.com/facebook/react/pull/28103 - https://github.com/facebook/react/pull/28098 - https://github.com/facebook/react/pull/28097 - https://github.com/facebook/react/pull/28068 - https://github.com/facebook/react/pull/28093 - https://github.com/facebook/react/pull/28094 - https://github.com/facebook/react/pull/28073 - https://github.com/facebook/react/pull/28084 - https://github.com/facebook/react/pull/28063 - https://github.com/facebook/react/pull/28085 - https://github.com/facebook/react/pull/28083 - https://github.com/facebook/react/pull/28065 - https://github.com/facebook/react/pull/28061 - https://github.com/facebook/react/pull/28077 - https://github.com/facebook/react/pull/28075 - https://github.com/facebook/react/pull/28078 - https://github.com/facebook/react/pull/28050 - https://github.com/facebook/react/pull/28011 - https://github.com/facebook/react/pull/28055 - https://github.com/facebook/react/pull/28066 - https://github.com/facebook/react/pull/28067 - https://github.com/facebook/react/pull/28010 - https://github.com/facebook/react/pull/27993 - https://github.com/facebook/react/pull/28052 - https://github.com/facebook/react/pull/28060 - https://github.com/facebook/react/pull/28059 - https://github.com/facebook/react/pull/28034 - https://github.com/facebook/react/pull/28033 - https://github.com/facebook/react/pull/28004 - https://github.com/facebook/react/pull/28051 - https://github.com/facebook/react/pull/28012 - https://github.com/facebook/react/pull/28001 - https://github.com/facebook/react/pull/28002 - https://github.com/facebook/react/pull/27995 - https://github.com/facebook/react/pull/28006 - https://github.com/facebook/react/pull/28005 - https://github.com/facebook/react/pull/28007 - https://github.com/facebook/react/pull/28008 - https://github.com/facebook/react/pull/28009 - https://github.com/facebook/react/pull/28000 - https://github.com/facebook/react/pull/28003 - https://github.com/facebook/react/pull/27997 - https://github.com/facebook/react/pull/27240 - https://github.com/facebook/react/pull/27977 - https://github.com/facebook/react/pull/27940 - https://github.com/facebook/react/pull/27939 - https://github.com/facebook/react/pull/28090 - https://github.com/facebook/react/pull/28089 - https://github.com/facebook/react/pull/28076 - https://github.com/facebook/react/pull/28074 - https://github.com/facebook/react/pull/28103 - https://github.com/facebook/react/pull/28098 - https://github.com/facebook/react/pull/28097 - https://github.com/facebook/react/pull/28068 - https://github.com/facebook/react/pull/28093 - https://github.com/facebook/react/pull/28094 - https://github.com/facebook/react/pull/28073 - https://github.com/facebook/react/pull/28084 - https://github.com/facebook/react/pull/28063 - https://github.com/facebook/react/pull/28085 - https://github.com/facebook/react/pull/28083 - https://github.com/facebook/react/pull/28065 - https://github.com/facebook/react/pull/28061 - https://github.com/facebook/react/pull/28077 - https://github.com/facebook/react/pull/28075 - https://github.com/facebook/react/pull/28078 - https://github.com/facebook/react/pull/28050 - https://github.com/facebook/react/pull/28011 - https://github.com/facebook/react/pull/28055 - https://github.com/facebook/react/pull/28066 - https://github.com/facebook/react/pull/28067 - https://github.com/facebook/react/pull/28010 - https://github.com/facebook/react/pull/27993 - https://github.com/facebook/react/pull/28052 - https://github.com/facebook/react/pull/28060 - https://github.com/facebook/react/pull/28059 - https://github.com/facebook/react/pull/28034 - https://github.com/facebook/react/pull/28033 - https://github.com/facebook/react/pull/28004 - https://github.com/facebook/react/pull/28051 - https://github.com/facebook/react/pull/28012 - https://github.com/facebook/react/pull/28001 - https://github.com/facebook/react/pull/28002 - https://github.com/facebook/react/pull/27995 - https://github.com/facebook/react/pull/28006 - https://github.com/facebook/react/pull/28005 - https://github.com/facebook/react/pull/28007 - https://github.com/facebook/react/pull/28008 - https://github.com/facebook/react/pull/28009 - https://github.com/facebook/react/pull/28000 - https://github.com/facebook/react/pull/28003 - https://github.com/facebook/react/pull/27997 - https://github.com/facebook/react/pull/27240 - https://github.com/facebook/react/pull/27977 - https://github.com/facebook/react/pull/27940 - https://github.com/facebook/react/pull/27939 Closes NEXT-2331
-
- 05 Feb, 2024 21 commits
-
-
Jiwon Choi authored
This PR fixes `.eslintrc.json` not being created after the user runs `next lint` and selects an option of `Strict` or `Base`. The reason is that the lint check was looking for `pages` and `src/pages` only. Added `app` and `src/app` to be checked also. Fixes: #55094 Fixes: #55102 --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Allan Guigal authored
### What? Currently, when a middleware is active and the path results in a 404, the server responds with a 200 status code to data requests. We propose a change to ensure that a 404 status code is returned in these situations, as expected, solving production issues for the navigation router. ### Why? The client data requests (identified with `_next/data` path & `x-nextjs-data` header) get answered the status code 200. The code below is executed when there is a version skew for the data requests (e.g prefetch in production). https://github.com/vercel/next.js/blob/4125069840ca98981f0e7796f55265af04f3e903/packages/next/src/server/lib/router-server.ts#L217-L227 The version skew consists in the client side version identified with the buildId in `__NEXT_DATA__ ` tag to be obsolete compared to the server version (`BUILD_ID` file). In the case of prefetching, this leads to the code above being executed, therefore the `prefetch-reducer.ts` handles the response as valid and sets it in its cache. Which ultimately triggers a navigation with empty prop, resulting in erroneous behaviours reported in issues and in our production websites: https://github.com/vercel/next.js/blob/4125069840ca98981f0e7796f55265af04f3e903/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.ts#L54-L74 By switching the response to a 404, we trigger this code in the fetch (`fetchServerResponse`). This change prompts a hard navigation (mpaNavigation), effectively refreshing the client version and resynching it with the server version. https://github.com/vercel/next.js/blob/4125069840ca98981f0e7796f55265af04f3e903/packages/next/src/client/components/router-reducer/fetch-server-response.ts#L125-L134 ### How? We simply update the status code to 404 here: https://github.com/vercel/next.js/blob/4125069840ca98981f0e7796f55265af04f3e903/packages/next/src/server/lib/router-server.ts#L223 Closes: https://github.com/vercel/next.js/pull/60785 Closes: https://github.com/vercel/next.js/issues/59295 Fixes: https://github.com/vercel/next.js/issues/47516 --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
vercel-release-bot authored
-
Aly Ahmed authored
### What? Fixes `setAssetPrefix` when running on a custom server using next() function ### Why? Looks like when we run next custom server, there are 2 instances created to handle this case * main server in `/server/next.ts` * and Render server `./server/lib/render-server.ts` The issue mainly happens when calling `setAssetPrefix` it will update only the main server and not render server ``` javascript const next = require('next') const app = next({ }); app.setAssetPrefix('my-fancy-cdn/static'); app.render(); // render server is used instead of the main server ``` ### How? when calling `setAssetPrefix` on the main server also update the render server with the same information. Fixes: #59940 Fixes: #51223 Fixes: #61383 ### Related Resources #53523 #49805 https://github.com/vercel/next.js/blob/c9c6ff6d77d3f7b61b955452bd31ec84c5e71cf0/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
OJ Kwon authored
### What This PR attempts to adjust import map to `server-only` / `client-only` close to the existing webpack configs, makes to pass more tests. Closes PACK-2396
-
Balázs Orbán authored
### What? This PR adds JSDoc comments to the most common public APIs to improve the DX in IDEs like VSCode. ### Why? Currently, we provide no information on some of the most used APIs in IDEs, which makes it harder than it needs to be to look up the extra information. <details> <summary><b>Before:</b></summary> <img src="https://github.com/vercel/next.js/assets/18369201/8b6092e8-8f9b-49da-a3df-b07a59982069" width="640"/> </details> <details> <summary><b>After:</b></summary> <img src="https://github.com/vercel/next.js/assets/18369201/30216f76-414a-43b0-9aa6-2fdd742ab3fe" width="640"/> </details> ### How? Using JSDoc comments, I added a basic description to most public APIs that link back to the current docs for more details. The description is kept minimal to avoid out-of-sync documentation. Note: In the future, the flow could be reversed here, and our API Reference docs could actually be generated from a single source of truth, the source code itself. However, this will require more work by re-organizing our public API submodules in a single directory, (related #61525), so the API docs are easy to maintain even without a deeper knowledge of the codebase. Note: These comments should also be extended to methods/properties/arguments in these public APIs in the future. Closes NEXT-2357 [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706735292633029)
-
Sandeep Mani Kumar Kushwaha authored
<!-- 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(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What? Issue - Docs: Duplicated code snippets The code snippet is repeated, second snippet had to be with Link component. ### How? Replaced button with Link component. Fixes #61434 - Docs: Duplicated code snippets --------- Co-authored-by:
Lee Robinson <me@leerob.io> Co-authored-by:
Sam Ko <sam@vercel.com>
-
vercel-release-bot authored
-
Balázs Orbán authored
### What? Removing `autoprefixer` from the default Tailwind CSS templates. (It can be installed afterward) ### Why? After some investigation by @timneutkens, `autoprefixer` seems to introduce some compilation overhead ### How? Removing `autoprefixer` from the auto-installed dependency list, it would be up to the developer to install this plugin if they need it. [Slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1695288906722539)
-
JJ Kasper authored
See here for additional context https://github.com/vercel/edge-runtime/pull/795 but TLDR is due to a bug in the `npmcli` we aren't able to publish Next.js releases after this package was upgraded. We can re-land the upgrade after that PR is landed/published. Reverts vercel/next.js#61030 Closes NEXT-2367
-
Balázs Orbán authored
### What? Expose the `MiddlewareConfig` interface. ### Why? You can now `import type { MiddlewareConfig } from "next/server"` to type the `config` object in your `middleware.ts` file. Now you an type the entire file for example like so: ```ts // middleware.ts import type { NextMiddleware, MiddlewareConfig } from "next/server" export const middleware: NextMiddleware = async (req) => { //... } export const config: MiddlewareConfig = { //... } ``` ### How? Re-exported the interface from its current location via `server/web/types`, to colocate it with `NextMidldeware`. I wonder if we could somehow type this file automatically, but it might be dependent on https://github.com/microsoft/TypeScript/issues/38511 Closes NEXT-2308 [Slack thread](https://vercel.slack.com/archives/C03S9JCH2Q5/p1706287433026409?thread_ts=1706058855.423019&cid=C03S9JCH2Q5), [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706659724141899) -
vercel-release-bot authored
-
JJ Kasper authored
Continuing to debug our failed npm publish with adding the debug logs as an artifact x-ref: https://github.com/vercel/next.js/actions/runs/7778346463/job/21207995884#step:11:828 Closes NEXT-2365
-
Tim Neutkens authored
## What? Updates the tests to correctly assert for Turbopack. <!-- 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(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2359
-
Donny/강동윤 authored
### What? Update `@swc/helpers` to `v0.5.5`. ### Why? - To apply https://github.com/swc-project/swc/pull/8574. This fixes a bug in helper, which can prevent useful operation while testing with `@next/jest`. (https://github.com/swc-project/swc/pull/8097 is also included, but it's not used by next.js) ### How? Closes PACK-2388
-
Tobias Koppers authored
### What? app api routes doesn't need to handle client components and server actions Closes PACK-2271
-
Vercel Release Bot authored
This auto-generated PR updates the integration test manifest used when testing Turbopack.
-
Sam Ko authored
## Description On [second thought](https://github.com/vercel/next.js/pull/48717), the previous heading size of (`##`) looks better. Closes NEXT-2358
-
Ishaan authored
## Improving Documentation ### The following changes have been made to the official repository's **Readme.md**: - Shortened link text across the readme. - Added additional descriptions for more details. - Added bold text to highlight emphasis on important topics - Changed heading sizes to indicate first headings (h1) for each section instead of second headings (h2) which was previously being used - Merged _'Who is using Next.js?'_ section with _'Getting Started'_ section for a more professional, cleaner look. ### The following changes have been made to the repository's **Contribution docs**: - Fixed two typos in the docs --------- Co-authored-by:
Sam Ko <sam@vercel.com> Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
vercel-release-bot authored
-