Add server-side and client-side entry points to App router #63732
olivierr91
started this conversation in
Ideas
Replies: 1 comment
-
Running into this now is there a workaround? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
Next feels like is missing a big hook in application lifecycle. There is currently no way to initialize things, except calling initialization routines at the top of every page and every layouts. It feels like a design issue for any serious application.
I am aware of instrumentation.ts, but it runs in a separate Node execution context and is run only once, so everything initialized in there is not accessible in other parts of the app (like pages and layouts). Initializing DI containers such as tsyringe in instrumentation.ts and accessing them in other parts of the app does not work.
Proposal
Add an server-side and client-side entry-point that is run on every request or app initialization.
Beta Was this translation helpful? Give feedback.
All reactions