-
Notifications
You must be signed in to change notification settings - Fork 0
AL's Storefront #1
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 all commits
ae42478
41dd7ec
bd492c1
2108385
c416e5a
037d027
3fa4be9
db7c3ca
00dc0ae
03d781a
6cda6cf
37badd6
55b639a
c5dbc1c
94c3caa
dbb75fa
e86208f
64f065d
ce20477
8f17ada
31d25cc
a570fe8
37892f0
3719958
3db894b
af7e182
6a7d368
0c19561
d6a8eec
1b22b54
7bdfd8c
421649f
a3afc89
b48f9c2
a1e6829
7061d39
0f7662b
cd31f40
4670f43
2994c9d
e816763
6b6c28e
fcdedc6
5d882d6
42e2f81
5e3fd85
c57316b
d1f88f9
ab46a2a
4821acf
b47e24c
16f72a2
049aaaf
45dd4bf
792e86c
be88d1c
31429f1
3918c83
203a58e
1fcb9ef
d0d2885
ce9c53b
9a78710
b040988
7567337
f684882
5e27f17
0f3a2c8
cdd8f42
59e4a4f
5e33185
cf86157
63ded9a
b17fc92
b15da97
93c39cd
e46dd59
02c928a
b67147e
1b5b0c5
4b92473
857c239
f3ad419
8dafc03
72b0429
758a75b
807fe6d
f88ceb4
1cfdce7
dfbb9c0
6e50b4b
b05cf90
086a22a
613fa54
def9133
2e6188b
7dc6014
38058e8
9b830da
d55a6a8
78d3c3f
a735e51
a3f6d9c
b0a6258
9d11d70
efc1460
aee9297
67de290
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 |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| # Diff da branch vs main | ||
|
|
||
| ## Escopo | ||
|
|
||
| - Branch atual: `feat/myaccountvtex` | ||
| - Base comparada: `main` | ||
| - Merge-base: `dd694199d49625184876bf6b422a8e886c9d1387` | ||
| - Data da coleta: 2026-03-05 | ||
|
|
||
| ## Resumo rapido | ||
|
|
||
| - Commits a frente da `main`: **96** | ||
| - Arquivos alterados: **70** | ||
| - Status: **45 modificados** e **25 novos** | ||
| - Delta total: **109137 insercoes** e **30651 remocoes** | ||
|
|
||
| ## Onde mudou mais | ||
|
|
||
| - `vtex`: 49 arquivos | ||
| - `power-reviews`: 5 arquivos | ||
| - `website`: 5 arquivos | ||
| - `blog`: 2 arquivos | ||
| - `htmx`: 2 arquivos | ||
| - Outros (`commerce`, `linx`, `shopify`, `vnda`, `wake`, `wap`): 1 arquivo cada | ||
| - Raiz do repo: 1 arquivo (`DIFF_MAIN_feat-myaccountvtex.md`) | ||
|
|
||
| ## Pontos de maior impacto (linhas alteradas) | ||
|
|
||
| > Observacao: grande parte do volume esta em arquivos OpenAPI gerados. | ||
|
|
||
| | Arquivo | Delta | | ||
| | ------------------------------------------------------ | --------------: | | ||
| | `vtex/utils/openapi/checkout.openapi.json` | +43725 / -0 | | ||
| | `vtex/utils/openapi/vcs.openapi.json` | +14251 / -22819 | | ||
| | `vtex/utils/openapi/checkout.openapi.gen.ts` | +27614 / -0 | | ||
| | `vtex/utils/openapi/logistics.openapi.json` | +12352 / -0 | | ||
| | `vtex/utils/openapi/vcs.openapi.gen.ts` | +243 / -7310 | | ||
| | `vtex/utils/openapi/logistics.openapi.gen.ts` | +6088 / -0 | | ||
| | `vtex/utils/openapi/vtexid.openapi.json` | +2088 / -0 | | ||
| | `vtex/utils/openapi/vtexid.openapi.gen.ts` | +594 / -0 | | ||
| | `vtex/loaders/intelligentSearch/productListingPage.ts` | +250 / -151 | | ||
| | `vtex/manifest.gen.ts` | +216 / -182 | | ||
| | `vtex/utils/types.ts` | +205 / -5 | | ||
|
|
||
| ## Mudancas relevantes fora de OpenAPI | ||
|
|
||
| - `vtex/loaders/intelligentSearch/productListingPage.ts`: ajustes grandes na | ||
| logica de PLP e parametros (pickup point, zip-code, filtros, etc.). | ||
| - `vtex/actions/*` e `vtex/loaders/*`: adicao/expansao de endpoints para | ||
| address, sessions, payments, orders, profile e credentials. | ||
| - `vtex/utils/types.ts`: expansao de contratos e tipos. | ||
| - `website/components/Image.tsx` e `website/components/Picture.tsx`: ajustes no | ||
| pipeline de imagem/render. | ||
| - `website/components/Seo.tsx` e `website/utils/html.ts`: alteracoes em SEO e | ||
| tratamento de HTML. | ||
| - `power-reviews/*`: novo loader `productReviews` e adaptacoes em | ||
| listagem/detalhe. | ||
| - `blog/*`: ajustes em `handlePosts` e `Template`. | ||
|
|
||
| ## Arquivos alterados (name-status) | ||
|
|
||
| ```text | ||
| A DIFF_MAIN_feat-myaccountvtex.md | ||
| M blog/core/handlePosts.ts | ||
| M blog/sections/Template.tsx | ||
| M commerce/types.ts | ||
| M htmx/mod.ts | ||
| M htmx/sections/htmx.tsx | ||
| M linx/loaders/product/listingPage.ts | ||
| M power-reviews/loaders/productDetailsPage.ts | ||
| M power-reviews/loaders/productListingPage.ts | ||
| A power-reviews/loaders/productReviews.ts | ||
| M power-reviews/manifest.gen.ts | ||
| M power-reviews/mod.ts | ||
| M shopify/loaders/ProductListingPage.ts | ||
| M vnda/loaders/productListingPage.ts | ||
| M vtex/actions/address/create.ts | ||
| A vtex/actions/address/createAddress.ts | ||
| A vtex/actions/address/deleteAddress.ts | ||
| M vtex/actions/address/update.ts | ||
| A vtex/actions/address/updateAddress.ts | ||
| M vtex/actions/cart/updateAttachment.ts | ||
| A vtex/actions/credentials/validate.ts | ||
| A vtex/actions/masterdata/updatePartialDocument.ts | ||
| M vtex/actions/newsletter/updateNewsletterOptIn.ts | ||
| A vtex/actions/payments/delete.ts | ||
| A vtex/actions/profile/newsletterProfile.ts | ||
| A vtex/actions/sessions/delete.ts | ||
| A vtex/loaders/address/getAddressByZIP.ts | ||
| A vtex/loaders/address/list.ts | ||
| M vtex/loaders/cart.ts | ||
| M vtex/loaders/categories/tree.ts | ||
| M vtex/loaders/config.ts | ||
| M vtex/loaders/intelligentSearch/productListingPage.ts | ||
| A vtex/loaders/intelligentSearch/searches.ts | ||
| M vtex/loaders/legacy/productList.ts | ||
| M vtex/loaders/legacy/productListingPage.ts | ||
| A vtex/loaders/logistics/listHolidays.ts | ||
| M vtex/loaders/logistics/listPickupPointsByLocation.ts | ||
| M vtex/loaders/orders/getById.ts | ||
| M vtex/loaders/orders/list.ts | ||
| A vtex/loaders/orders/order.ts | ||
| A vtex/loaders/payments/info.ts | ||
| A vtex/loaders/payments/userPayments.ts | ||
| A vtex/loaders/profile/passwordLastUpdate.ts | ||
| A vtex/loaders/sessions/info.ts | ||
| M vtex/loaders/user.ts | ||
| M vtex/manifest.gen.ts | ||
| M vtex/middleware.ts | ||
| M vtex/mod.ts | ||
| M vtex/utils/client.ts | ||
| M vtex/utils/intelligentSearch.ts | ||
| M vtex/utils/legacy.ts | ||
| A vtex/utils/openapi/checkout.openapi.gen.ts | ||
| A vtex/utils/openapi/checkout.openapi.json | ||
| A vtex/utils/openapi/logistics.openapi.gen.ts | ||
| A vtex/utils/openapi/logistics.openapi.json | ||
| M vtex/utils/openapi/vcs.openapi.gen.ts | ||
| M vtex/utils/openapi/vcs.openapi.json | ||
| A vtex/utils/openapi/vtexid.openapi.gen.ts | ||
| A vtex/utils/openapi/vtexid.openapi.json | ||
| M vtex/utils/orderForm.ts | ||
| M vtex/utils/segment.ts | ||
| M vtex/utils/types.ts | ||
| M vtex/utils/vtexId.ts | ||
| M wake/loaders/productListingPage.ts | ||
| M wap/loaders/productListingPage.ts | ||
| M website/components/Events.tsx | ||
| M website/components/Image.tsx | ||
| M website/components/Picture.tsx | ||
| M website/components/Seo.tsx | ||
| M website/utils/html.ts | ||
| ``` | ||
|
|
||
| ## Comandos usados para gerar este documento | ||
|
|
||
| ```bash | ||
| git rev-list --count main..HEAD | ||
| git merge-base main HEAD | ||
| git diff --shortstat main...HEAD | ||
| git diff --name-status main...HEAD | ||
| git diff --numstat main...HEAD | ||
| ``` |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,17 +2,25 @@ import { Head } from "$fresh/runtime.ts"; | |||||||||||||||||||||||||||
| import { AppContext, Extension } from "../mod.ts"; | ||||||||||||||||||||||||||||
| import { type SectionProps } from "@deco/deco"; | ||||||||||||||||||||||||||||
| import { useScript } from "@deco/deco/hooks"; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const script = (extensions: Extension[]) => { | ||||||||||||||||||||||||||||
| if (extensions.length > 0) { | ||||||||||||||||||||||||||||
| if (document.readyState === "complete") { | ||||||||||||||||||||||||||||
| document.body.setAttribute("hx-ext", extensions.join(",")); | ||||||||||||||||||||||||||||
| document.body.setAttribute( | ||||||||||||||||||||||||||||
| "hx-ext", | ||||||||||||||||||||||||||||
| extensions.map((ext) => ext.name).join(","), | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| globalThis.onload = () => { | ||||||||||||||||||||||||||||
| document.body.setAttribute("hx-ext", extensions.join(",")); | ||||||||||||||||||||||||||||
| document.body.setAttribute( | ||||||||||||||||||||||||||||
| "hx-ext", | ||||||||||||||||||||||||||||
| extensions.map((ext) => ext.name).join(","), | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||
|
Comment on lines
15
to
20
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify if global onload assignment is used elsewhere and could be clobbered.
rg -n --type=ts --type=tsx 'globalThis\.onload\s*=' -C2
rg -n --type=ts --type=tsx 'addEventListener\(\s*["'"'"']load["'"'"']' -C2Repository: vitoUwu/apps Length of output: 112 🏁 Script executed: #!/bin/bash
# First, locate and read the file
find . -name "htmx.tsx" -type fRepository: vitoUwu/apps Length of output: 81 🏁 Script executed: #!/bin/bash
# Search for globalThis.onload assignments without type restrictions
rg 'globalThis\.onload\s*=' -C 3Repository: vitoUwu/apps Length of output: 383 🏁 Script executed: #!/bin/bash
# Search for addEventListener with load event
rg 'addEventListener.*load' -C 2Repository: vitoUwu/apps Length of output: 1530 🏁 Script executed: #!/bin/bash
cat -n ./htmx/sections/htmx.tsxRepository: vitoUwu/apps Length of output: 1656 Avoid overriding the global Using Safer event wiring- globalThis.onload = () => {
+ globalThis.addEventListener("load", () => {
document.body.setAttribute(
"hx-ext",
extensions.map((ext) => ext.name).join(","),
);
- };
+ }, { once: true });📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| function Section({ version, cdn, extensions }: SectionProps<typeof loader>) { | ||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||
| <Head> | ||||||||||||||||||||||||||||
|
|
@@ -27,7 +35,7 @@ function Section({ version, cdn, extensions }: SectionProps<typeof loader>) { | |||||||||||||||||||||||||||
| {extensions.map((ext) => ( | ||||||||||||||||||||||||||||
| <script | ||||||||||||||||||||||||||||
| defer | ||||||||||||||||||||||||||||
| src={`${cdn}/htmx.org@${version}/dist/ext/${ext}.js`} | ||||||||||||||||||||||||||||
| src={ext.url} | ||||||||||||||||||||||||||||
| crossOrigin="anonymous" | ||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,3 +78,5 @@ export default function productDetailsPage( | |
| }; | ||
| }; | ||
| } | ||
|
|
||
| export const cache = "no-cache"; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve legacy extension compatibility and validate extension URLs before state hydration.
This API change can break existing persisted configs that still store extensions as strings, and it now allows unrestricted script origins via
url. Please normalize legacy values and enforce URL validation/allowlisting before exposingextensionsin app state.Suggested hardening + migration pattern
export interface Extension { name: string; url: string; } +export type ExtensionInput = Extension | string; export interface Props { /** `@default` 1.9.12 */ version?: string; /** `@default` https://cdn.jsdelivr.net/npm */ cdn?: string; /** `@title` HTMX extensions to include */ - extensions?: Extension[]; + extensions?: ExtensionInput[]; } + +const TRUSTED_EXTENSION_HOSTS = new Set([ + "cdn.jsdelivr.net", +]); + +const LEGACY_EXTENSION_URLS: Record<string, string> = { + // Fill with previously supported extension identifiers -> URL mapping. +}; + +const normalizeExtension = (input: ExtensionInput): Extension | null => { + if (typeof input === "string") { + const legacyUrl = LEGACY_EXTENSION_URLS[input]; + return legacyUrl ? { name: input, url: legacyUrl } : null; + } + + try { + const parsed = new URL(input.url); + if (parsed.protocol !== "https:") return null; + if (!TRUSTED_EXTENSION_HOSTS.has(parsed.hostname)) return null; + return { name: input.name.trim(), url: parsed.href }; + } catch { + return null; + } +}; export default function Site(state: Props): App<Manifest, Required<Props>> { return { state: { version: state.version ?? "1.9.12", cdn: state.cdn ?? "https://cdn.jsdelivr.net/npm", - extensions: state.extensions ?? [], + extensions: (state.extensions ?? []) + .map(normalizeExtension) + .filter((ext): ext is Extension => ext !== null), }, manifest, }; }Also applies to: 20-20
🤖 Prompt for AI Agents