rsnext/packages/next/build/webpack
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
..
config Bypass empty pages folder for layouts (#40132) 2022-09-03 00:13:47 +00:00
loaders Improved route resolution in next-app-loader (#40109) 2022-09-06 10:03:21 -07:00
plugins Bypass empty pages folder for layouts (#40132) 2022-09-03 00:13:47 +00:00
require-hook.ts Remove precopied styled-jsx (#39520) 2022-08-12 17:08:38 +00:00
stringify-request.ts Update loader-utils (#30743) 2021-11-02 16:13:15 +01:00