-
Notifications
You must be signed in to change notification settings - Fork 21
feat: enhance router to skip catch-all routes for paths with file ext… #1487
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,7 +12,6 @@ import { | |||||||||||
| type FnContext, | ||||||||||||
| type Site, | ||||||||||||
| } from "@deco/deco"; | ||||||||||||
| import { VTEX_PATHS_THAT_REQUIRES_SAME_REFERER } from "../vtex/loaders/proxy.ts"; | ||||||||||||
|
|
||||||||||||
| declare global { | ||||||||||||
| interface Window { | ||||||||||||
|
|
@@ -77,6 +76,7 @@ export interface AbTesting { | |||||||||||
| includeScriptsToBody?: { | ||||||||||||
| includes?: Script[]; | ||||||||||||
| }; | ||||||||||||
| pathsThatRequireSameReferer?: string[]; | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Add documentation for the new property. The Apply this diff to add documentation: + /**
+ * @description Paths that require the same referer for A/B test routing
+ */
pathsThatRequireSameReferer?: string[];📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| } | ||||||||||||
| /** @titleBy framework */ | ||||||||||||
| interface Fresh { | ||||||||||||
|
|
@@ -209,7 +209,9 @@ const getAbTestAudience = (abTesting: AbTesting) => { | |||||||||||
| includeScriptsToHead: abTesting.includeScriptsToHead, | ||||||||||||
| includeScriptsToBody: abTesting.includeScriptsToBody, | ||||||||||||
| replaces: abTesting.replaces, | ||||||||||||
| pathsThatRequireSameReferer: [...VTEX_PATHS_THAT_REQUIRES_SAME_REFERER], | ||||||||||||
| pathsThatRequireSameReferer: [ | ||||||||||||
| ...(abTesting.pathsThatRequireSameReferer ?? []), | ||||||||||||
| ], | ||||||||||||
|
Comment on lines
+212
to
+214
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify this change aligns with PR objectives. The PR title indicates it's about "skip catch-all routes for paths with file ext…" but this change relates to referer-based path matching for A/B testing. This appears unrelated to file extension handling. 🤖 Prompt for AI Agents |
||||||||||||
| }, | ||||||||||||
| }; | ||||||||||||
| if (abTesting.enabled) { | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.