rsnext/test/e2e/app-dir
Ngô Đức Anh a4b430e6f1
Better IPv6 support for next-server (#53131)
### What?
This PR makes it easier to use Next.js with IPv6 hostnames such as `::1` and `::`.

### How?
It does so by removing rewrites from `localhost` to `127.0.0.1` introduced in #52492. It also fixes the issue where Next.js tries to fetch something like `http://::1:3000` when `--hostname` is `::1` as it is not a valid URL (browsers' `URL` class throws an error when constructed with such hosts). It also fixes `NextURL` so that it doesn't accept `http://::1:3000` but refuse `http://[::1]:3000`. It also changes `next/src/server/lib/setup-server-worker.ts` so that it uses the server's `address` method to retrieve the host instead of our provided `opts.hostname`, ensuring that no matter what `opts.hostname` is we will always get the correct one.

### Note
I've verified that `next dev`, `next start` and `node .next/standalone/server.js` work with IPv6 hostnames (such as `::` and `::1`), IPv4 hostnames (such as `127.0.0.1`, `0.0.0.0`) and `localhost` - and with any of these hostnames fetching to `localhost` also works. Server Actions and middleware have no problems as well.

This also removes `.next/standalone/server.js`'s logging as we now use `start-server`'s logging to avoid duplicates. `start-server`'s logging has also been updated to report the actual hostname.
![image](https://github.com/vercel/next.js/assets/75556609/cefa5f23-ff09-4cef-a055-13eea7c11d89)
![image](https://github.com/vercel/next.js/assets/75556609/619e82ce-45d9-47b7-8644-f4ad083429db)
The above pictures also demonstrate using Server Actions with Next.js after this PR.
![image](https://github.com/vercel/next.js/assets/75556609/3d4166e9-f950-4390-bde9-af2547658148)

Fixes #53171
Fixes #49578
Closes NEXT-1510

Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2023-08-14 07:23:24 +00:00
..
_allow-underscored-root-directory Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
actions Add warnings for static generation bail outs (#53761) 2023-08-08 20:09:34 -07:00
app Better IPv6 support for next-server (#53131) 2023-08-14 07:23:24 +00:00
app-a11y Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-alias Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
app-basepath Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-client-cache Renable flaky tests disabled before (#51680) 2023-07-03 09:29:28 +00:00
app-compilation Fix HMR for missing dependencies in next-app-loader (#51778) 2023-06-25 19:26:09 +00:00
app-css Fix resource being preloaded multiple times during development (#53525) 2023-08-03 15:15:44 +00:00
app-css-pageextensions Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-edge Add warning logs for incorrect page exports (#53449) 2023-08-01 13:59:20 -07:00
app-edge-root-layout Fix static metadata routes runtime when root layout is in edge runtime (#50351) 2023-05-25 15:39:57 -07:00
app-external Avoid unnecessary resolveExternal calls (#52053) 2023-07-03 10:34:46 +02:00
app-fetch-deduping fix: fetch deduping in dev (#53549) 2023-08-03 15:10:55 -07:00
app-middleware Allow next/headers in middleware & draftMode in edge runtime (#53465) 2023-08-02 20:22:35 +00:00
app-prefetch fix: Add Next-Url to http vary in consideration of intercept routes. (#52746) 2023-07-22 21:38:23 +00:00
app-prefetch-false type check tests (and convert next-test-utils.js to ts) (#51071) 2023-06-23 17:42:50 +00:00
app-rendering Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-routes Support basePath with edge runtime for Custom App Routes (#52910) 2023-07-19 23:54:34 +00:00
app-routes-trailing-slash Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-simple-routes Turbopack: add edge app routes (#53387) 2023-08-07 13:00:06 +02:00
app-static Reduce flakiness of app-fetch-logging test (#53612) 2023-08-05 16:12:21 +00:00
app-validation Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
asset-prefix Add new build and test workflow (#50436) 2023-05-27 21:02:31 -07:00
async-component-preload Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
autoscroll-with-css-modules Updates prettier to latest version. (#51000) 2023-06-09 14:58:19 +00:00
back-button-download-bug Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
base-path Remove Base Path from usePathname output (#53582) 2023-08-04 22:10:00 +00:00
build-size Split the client reference manifest file to be generated per-entry (#52450) 2023-07-10 09:48:03 +02:00
create-next-app-template Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
create-root-layout Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
crypto-globally-available Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
deopted-into-client-rendering-warning Ensure NEXT_DYNAMIC_NO_SSR_CODE has a unique name (#50219) 2023-05-23 08:37:57 -07:00
draft-mode Allow next/headers in middleware & draftMode in edge runtime (#53465) 2023-08-02 20:22:35 +00:00
dynamic Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
dynamic-href Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
edge-runtime-node-compatibility Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
error-boundary-and-not-found-linking Fix not found hangs the build with overridden node env (#53106) 2023-07-24 21:00:53 +00:00
front-redirect-issue Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
global-error Add test for catching metadata error in error boundaries (#53581) 2023-08-04 20:57:49 +02:00
headers-static-bailout Add docs page for uncaught DynamicServerErrors (#53402) 2023-08-08 12:49:53 +02:00
hello-world Bail out of 404 page when favicon.ico doesn't exist (#50795) 2023-06-06 10:58:40 +02:00
hooks Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
i18n-hybrid Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
import Support scroll: false for Link component for app router (#51869) 2023-07-04 10:25:25 +02:00
interception-middleware-rewrite Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
interoperability-with-pages improve error DX on pages with RSC build errors (#52843) 2023-07-20 00:32:57 +00:00
layout-params Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
mdx Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
metadata Use summary_large_image as twitter card if images present by default (#53919) 2023-08-11 17:52:45 +00:00
metadata-dynamic-routes Add changeFrequency and priority attributes to sitemaps (#48484) 2023-08-09 20:36:22 +00:00
metadata-edge Fix tree shaking for image generation module (#51950) 2023-07-04 18:19:08 +00:00
metadata-missing-metadata-base fix: metadatabase warning message (#52363) 2023-07-07 00:08:10 +00:00
metadata-suspense Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
navigation Reland "Refine the not-found rendering process for app router" (#52985) 2023-07-21 10:09:30 -07:00
next-config Avoid loading Next.js config again in render workers (#52587) 2023-07-12 11:21:05 +00:00
next-font Simplify server CSS handling (#51018) 2023-06-14 14:43:08 -07:00
next-image fix: edge runtime with next/legacy/image (#50343) 2023-05-26 13:38:10 +02:00
not-found Recover not found errors from flight data to render with proper boundary (#53703) 2023-08-12 08:41:47 +00:00
not-found-default Move metadata error under error boundaries (#53551) 2023-08-04 15:32:36 +00:00
pages-to-app-routing Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
parallel-routes-and-interception improve error message for conflicting parallel segments (#53803) 2023-08-09 17:21:24 +00:00
parallel-routes-not-found Recover not found errors from flight data to render with proper boundary (#53703) 2023-08-12 08:41:47 +00:00
rewrites-redirects Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
root-layout Ensure root layout only render once per request (#52589) 2023-07-13 17:34:31 +02:00
root-layout-redirect Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
root-layout-render-once Ensure root layout only render once per request (#52589) 2023-07-13 17:34:31 +02:00
route-page-manifest-bug Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
router-autoscroll Support scroll: false for Link component for app router (#51869) 2023-07-04 10:25:25 +02:00
router-stuck-dynamic-static-segment Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
rsc-basic Fix/match resource (#53796) 2023-08-11 17:36:58 +00:00
search-params-react-key Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
searchparams-static-bailout Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
set-cookies type check tests (and convert next-test-utils.js to ts) (#51071) 2023-06-23 17:42:50 +00:00
similar-pages-paths Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
test-template/{{ toFileName name }} Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
third-parties Adding GoogleMaps and Youtube embed components (#52909) 2023-08-07 19:38:13 +00:00
trailingslash Add new build and test workflow (#50436) 2023-05-27 21:02:31 -07:00
underscore-ignore-app-paths Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
use-params Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
use-selected-layout-segment-s Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
with-babel Apply optimization to middleware when using babel (#51067) 2023-06-09 13:33:14 -07:00
with-exported-function-config add version to function config manifest (#52507) 2023-07-10 20:28:59 +00:00