rsnext/packages/next/build/webpack/loaders
Shu Ding 5f95b6b050
Improved route resolution in next-app-loader (#40109)
This PR implements the logic to make next-app-loader able to match multiple routes.

The app loader is refactored to construct the tree recursively instead of within a loop, as there could be multiple branches. Similarly, when entering a new layout level or branch, we resolve both the slot name (defaults to `"children"`) and the segment.

In order to make that work, the loader has to know all matched app paths. This is passed in as the `appPaths` loader option, which is gathered when creating the entrypoint.

## 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)

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-06 10:03:21 -07:00
..
css-loader fix: data url handling in css-loader (#34034) 2022-02-06 11:10:14 -06:00
next-edge-ssr-loader Update to detect GSSP with edge runtime during build (#40076) 2022-08-30 18:18:02 +00:00
next-flight-client-loader Error for ssg and ssr exports from client components in build time (#40106) 2022-08-31 13:13:47 +00:00
next-serverless-loader Update to detect GSSP with edge runtime during build (#40076) 2022-08-30 18:18:02 +00:00
next-style-loader Update loader-utils (#30743) 2021-11-02 16:13:15 +01:00
postcss-loader Lazy-load postcss (#31762) 2021-11-25 18:41:20 +01:00
resolve-url-loader Move resolve-url-loader into Next.js (#32932) 2022-01-02 16:16:17 -06:00
error-loader.ts Remove webpack4 types (#39631) 2022-08-16 09:55:37 +00:00
get-module-build-info.ts feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
next-app-loader.ts Improved route resolution in next-app-loader (#40109) 2022-09-06 10:03:21 -07:00
next-client-pages-loader.ts Decouple entries for server components and client components (#36860) 2022-05-13 19:48:53 +02:00
next-edge-function-loader.ts fix(edge-runtime): undefined global in edge runtime. (#38769) 2022-07-20 14:53:27 +00:00
next-flight-client-entry-loader.ts fix next-app-loader on windows (#39657) 2022-08-17 17:14:03 +00:00
next-flight-css-dev-loader.ts HMR for client CSS imports (#39916) 2022-08-25 16:40:16 +00:00
next-flight-server-loader.ts Decouple entries for server components and client components (#36860) 2022-05-13 19:48:53 +02:00
next-image-loader.js Update next/future/image to use svg blur placeholder during next dev (#39992) 2022-08-29 17:19:39 -05:00
next-middleware-asset-loader.ts [edge] allow importing blob assets (#38492) 2022-07-19 12:27:15 -05:00
next-middleware-loader.ts feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
next-middleware-wasm-loader.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
next-swc-loader.js fix(next/swc): set cache dir explicitly (#38175) 2022-06-29 21:59:52 +00:00
noop-loader.ts Remove webpack4 types (#39631) 2022-08-16 09:55:37 +00:00
utils.ts fix next-app-loader on windows (#39657) 2022-08-17 17:14:03 +00:00