Skip to content

Add page-context logic#65897

Closed
alexdln wants to merge 2 commits into
vercel:canaryfrom
alexdln:get-page-context
Closed

Add page-context logic#65897
alexdln wants to merge 2 commits into
vercel:canaryfrom
alexdln:get-page-context

Conversation

@alexdln

@alexdln alexdln commented May 17, 2024

Copy link
Copy Markdown
Contributor

What?

We need the ability to obtain data about the page in server components. Primarily for localization, but there are hundreds and thousands of cases where this is necessary. I understand the problems of creating context functions (and recently wrote my results on this here).

But we need a method. Here I propose another way (although I am still waiting for PR on getPathname, despite the fact that it feels great in my package). This is the same functionality that you use when generating pages. It covers a huge number of cases.

Please, look in this direction. This is a very, very serious problem for static applications.

image


I still do not know all the intricacies of next.js. Therefore, please, give an answer - what is wrong, where else to add this logic, where to write tests, what to consider and check!

Fixes #50405, #43704, #42301, #58862, #50575, etc.

@ijjk

ijjk commented May 17, 2024

Copy link
Copy Markdown
Member

Allow CI Workflow Run

  • approve CI run for commit: f3129fc

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

@alexdln

alexdln commented Mar 18, 2026

Copy link
Copy Markdown
Contributor Author

Looks like the rootParams will cover all the main issue that I solved in this PR

@alexdln alexdln closed this Mar 18, 2026
@alexdln alexdln deleted the get-page-context branch March 18, 2026 21:54
@MurzNN

MurzNN commented Mar 19, 2026

Copy link
Copy Markdown

Looks like the rootParams will cover all the main issue that I solved in this PR

Where can I get more info about the rootParams? I see the mention only here https://nextjs.org/docs/app/guides/upgrading/version-16#unstable_rootparams that declares that it was removed:

The unstable_rootParams function has been removed. We are working on an alternative API that we will ship in an upcoming minor release.

@alexdln

alexdln commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

As far as I know, this hasn't been particularly described yet, but in linked release it was removed as experimental and became stable

Probably the best place to learn more and track progress is this issue - amannn/next-intl#663 (comment) And probably amannn's socials

@github-actions github-actions Bot added the locked label Apr 2, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants