Skip to content

feat: handle rootParams in routes (finish changes)#81086

Merged
lubieowoce merged 2 commits into
lubieowoce/root-params-in-route-handlersfrom
root-params-in-route-handlers-2
Jul 9, 2025
Merged

feat: handle rootParams in routes (finish changes)#81086
lubieowoce merged 2 commits into
lubieowoce/root-params-in-route-handlersfrom
root-params-in-route-handlers-2

Conversation

@bgub

@bgub bgub commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

Enable root params in route handlers

This PR enables the use of root params in route handlers by:

  1. Modifying the app route module to extract root params from context.params based on rootParamNames
  2. Passing these root params to the request store in route handlers
  3. Removing the error that previously prevented using root params in route handlers
  4. Simplifying the rootParams handling by directly using string arrays instead of ParamInfo objects
  5. Replacing the custom encodeToBase64 utility with standard Buffer.from().toString('base64')

The changes ensure that route handlers can properly access root params like lang() and locale() from the next/root-params API.

Fixes #[issue-number]

@ijjk

ijjk commented Jun 30, 2025

Copy link
Copy Markdown
Member

Allow CI Workflow Run

  • approve CI run for commit: f6dd34b

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

This was referenced Jun 30, 2025

bgub commented Jun 30, 2025

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@bgub bgub changed the title feat: handle rootParams in routes (webpack) feat: handle rootParams in routes (finish changes) Jun 30, 2025
@ijjk ijjk added the Turbopack Related to Turbopack with Next.js. label Jun 30, 2025
preferredRegion: staticInfo.preferredRegion,
middlewareConfig: encodeToBase64(staticInfo.middleware || {}),
middlewareConfig: Buffer.from(
JSON.stringify(staticInfo.middleware || {})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the way the file seems to encode in base64 in other places... but I'm not sure if it was different here for a reason. I can also split this off into a separate PR

@bgub bgub requested a review from lubieowoce June 30, 2025 21:35
@codspeed-hq

codspeed-hq Bot commented Jun 30, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #81086 will not alter performance

Comparing root-params-in-route-handlers-2 (4d895e4) with canary (639c731)

Summary

✅ 9 untouched benchmarks

@lubieowoce lubieowoce force-pushed the lubieowoce/root-params-in-route-handlers branch from 2a607fc to b4fe9d1 Compare July 9, 2025 19:11
@lubieowoce lubieowoce force-pushed the root-params-in-route-handlers-2 branch from f6dd34b to 4d895e4 Compare July 9, 2025 19:11
@ijjk ijjk added the created-by: Next.js team PRs by the Next.js team. label Jul 9, 2025
@lubieowoce lubieowoce marked this pull request as ready for review July 9, 2025 19:11
@lubieowoce lubieowoce merged this pull request into lubieowoce/root-params-in-route-handlers Jul 9, 2025
60 of 78 checks passed
@lubieowoce lubieowoce deleted the root-params-in-route-handlers-2 branch July 9, 2025 19:12
lubieowoce pushed a commit that referenced this pull request Jul 9, 2025
## Enable root params in route handlers

This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 9, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 10, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 11, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 17, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 17, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 21, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
lubieowoce pushed a commit that referenced this pull request Jul 21, 2025
This PR enables the use of root params in route handlers by:

1. Modifying the app route module to extract root params from
context.params based on rootParamNames
2. Passing these root params to the request store in route handlers
3. Removing the error that previously prevented using root params in
route handlers
4. Simplifying the rootParams handling by directly using string arrays
instead of ParamInfo objects
5. Replacing the custom encodeToBase64 utility with standard
Buffer.from().toString('base64')
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Next.js team PRs by the Next.js team. locked Rspack tests Turbopack Related to Turbopack with Next.js. type: next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants