Skip to content

Add page-context logic#65897

Open
alexdln wants to merge 2 commits intovercel:canaryfrom
alexdln:get-page-context
Open

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

Conversation

@alexdln
Copy link
Contributor

@alexdln alexdln commented May 17, 2024

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
Copy link
Member

ijjk commented May 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants