-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: enhance locale handling with AsyncLocalStorage support for server-side requests #7826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JerryWu1234
wants to merge
24
commits into
QwikDev:build/v2
Choose a base branch
from
JerryWu1234:buildv2async
base: build/v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4664b34
feat: enhance locale handling with AsyncLocalStorage support for serv…
JerryWu1234 90890c9
add changeset
JerryWu1234 25d1648
fix: improve locale handling in resolveHead function with AsyncLocalS…
JerryWu1234 0abc9d8
refactor: streamline locale handling with AsyncLocalStorage for serve…
JerryWu1234 27dd795
refactor: remove unnecessary comment and simplify store retrieval in …
JerryWu1234 1c341e4
refactor: simplify AsyncLocalStorage usage and improve locale retriev…
JerryWu1234 92d67da
refactor: unify AsyncLocalStorage usage across router middleware and …
JerryWu1234 ce8d18b
Merge branch 'build/v2' into buildv2async
JerryWu1234 559b9f3
refactor: streamline AsyncLocalStorage usage in locale functions and …
JerryWu1234 0e148b7
refactor: simplify AsyncLocalStorage usage and improve locale retriev…
JerryWu1234 c1c07c6
refactor: remove debug log for AsyncLocalStorage in user-response.ts
JerryWu1234 888e4df
refactor: enhance AsyncLocalStorage integration in request handling a…
JerryWu1234 1609ffd
refactor: remove server-side check in setLocale and update asyncReque…
JerryWu1234 ef75798
refactor: optimize AsyncLocalStorage handling in locale functions and…
JerryWu1234 1293991
refactor: add server-side check for AsyncLocalStorage initialization …
JerryWu1234 0195432
solve conflict
JerryWu1234 e97bc40
refactor: update import paths for core modules in async-request-store…
JerryWu1234 e1bd82c
refactor(router): improve plugin retrieval logic in Vite adapter
JerryWu1234 412a0e3
refactor(router): unify plugin retrieval logic in Vite adapter and bu…
JerryWu1234 bd3925a
refactor(router): add double type assertion to avoid TypeScript stack…
JerryWu1234 73e5e06
Merge branch 'build/v2' into buildv2async
JerryWu1234 f815a32
refactor(router): enhance head resolution logic to support async requ…
JerryWu1234 23966f2
Merge branch 'build/v2' into buildv2async
JerryWu1234 a50d819
refactor(router): replace asyncRequestStore with global qcAsyncReques…
JerryWu1234 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@qwik.dev/router': patch | ||
'@qwik.dev/core': patch | ||
--- | ||
|
||
enhance locale handling with AsyncLocalStorage support for server-side requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/qwik-router/src/middleware/request-handler/async-request-store.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { RequestEventInternal } from './request-event'; | ||
import type { AsyncLocalStorage } from 'node:async_hooks'; | ||
|
||
export type AsyncStore = AsyncLocalStorage<RequestEventInternal>; | ||
|
||
// Qwik Core will also be using the async store if this is present | ||
export let asyncRequestStore: AsyncStore | undefined; | ||
|
||
export const setAsyncRequestStore = (store: AsyncStore | undefined) => { | ||
asyncRequestStore = store; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JerryWu1234 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.