Skip to content

fix: vtex day#3278

Draft
hellofanny wants to merge 41 commits into
devfrom
feat/vtex-day
Draft

fix: vtex day#3278
hellofanny wants to merge 41 commits into
devfrom
feat/vtex-day

Conversation

@hellofanny

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

How it works?

How to test it?

Starters Deploy Preview

References

Checklist

You may erase this after checking them all 😉

PR Title and Commit Messages

  • PR title and commit messages follow the Conventional Commits specification
    • Available prefixes: feat, fix, chore, docs, style, refactor, ci and test

PR Description

  • Added a label according to the PR goal - breaking change, bug, contributing, performance, documentation..

Dependencies

  • Committed the pnpm-lock.yaml file when there were changes to the packages

Documentation

  • PR description
  • For documentation changes, ping @Mariana-Caetano to review and update (Or submit a doc request)

matheusps and others added 30 commits November 18, 2025 15:58
Merge the changes from main
## What's the purpose of this pull request?

With these changes, if merchants remove the footer logo the entire
footer component will not be hid anymore, it will throw a console error
but the component should be displayed with no logo.
#3077)

## What's the purpose of this pull request?

This PR fixes the `border-radius` of the Slider thumb in Firefox. The
current CSS rule for Mozilla uses an inexistent variable, making the
browser render a square instead of a circle:

<img width="1028" height="181" alt="image"
src="https://github.com/user-attachments/assets/50c08d79-a6a9-4d31-b2e7-5ef9e287080f"
/>

## How it works?

The `--fs-slider-thumb-radius` variable is replaced by
`--fs-slider-thumb-border-radius`, the one that is defined in the
default thumb variables.

## How to test it?

- Use the `Local Install Instructions` from the [CodeSandbox
CI](https://ci.codesandbox.io/status/vtex/faststore/pr/3077) to add this
version in the `package.json` of a store.
- Import the `Slider` atom (and styles) in a component following the
docs: https://developers.vtex.com/docs/guides/faststore/atoms-slider
- Run the store in development mode and browse it in Mozilla Firefox.

### Starters Deploy Preview

I'm unable to generate a preview link but here's a screenshot from
localhost:

<img width="1287" height="617" alt="image"
src="https://github.com/user-attachments/assets/f0a5a5e9-d657-41db-9415-303b5d17fefd"
/>

## Checklist

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..
_(No permissions. It's a bug though.)_

**Dependencies**

- [N/A] Committed the `pnpm-lock.yaml` file when there were changes to
the packages

**Documentation**

- [x] PR description
- [N/A] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)
- Add RTL Support

---------

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Co-authored-by: Leandro Rodrigues <leandro.swf@gmail.com>
Co-authored-by: Eduardo Formiga <eduardo.formiga@gmail.com>
Co-authored-by: vtexgithubbot <vtexgithubbot@github.com>
Co-authored-by: Lucas Feijó <lucas.portela@vtex.com>
## What's the purpose of this pull request?

Upgrading next version to 15

---------

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Co-authored-by: Matheus P. Silva <cout.matheusps@gmail.com>
Co-authored-by: Leandro Rodrigues <leandro.swf@gmail.com>
Co-authored-by: Eduardo Formiga <eduardo.formiga@gmail.com>
Co-authored-by: vtexgithubbot <vtexgithubbot@github.com>
Co-authored-by: Lucas Feijó <lucas.portela@vtex.com>
Co-authored-by: Luiz Falcão <39093175+llfalcao@users.noreply.github.com>
Co-authored-by: Fanny Chien <fanny.chien@vtex.com>
Externalizing crypto module from vite to correct import it
Added run scripts to run core package. 

- dev script
build script cant be commited as CI would fail cause it needs the cli do
be build before, and the cli only runs after the core as it is a direct
dep.
So turbo doesn't allow circular dependency on scripts
Updated dependencies:
- "@testing-library/jest-dom"
- "@lhci/cli": "^0.15.1",
- "@graphql-codegen/cli": 6.1.1 - Updated to V6 as it was triggering
warns in respect to their dependencies
- [REMOVED] @types/cypress - Its not necessary on our current version of
cypress anymore
- [REMOVED] "@storybook/addon-interactions": "^8.6.14" - Is part of core
storybook package now
- [REMOVED] "@storybook/test": "^8.6.14" - Is part of core storybook
package now

- Removed unnecessary storybook addons that is part of storybook@9.
- Migrate packages tests that used jest to vitest, Removed vite
configurations and created vitest.
- Updated pnpm to latest version stable.



[NOW]

<img width="1112" height="140" alt="image"
src="https://github.com/user-attachments/assets/89d318b8-7ba8-49e9-b1c6-9c3a17a8ff98"
/>


[BEFORE]

<img width="2615" height="350" alt="image"
src="https://github.com/user-attachments/assets/29d1cb09-5e58-4add-85fc-e8d72ba065ea"
/>


- Deps unable to fix: 
> domexception@1.0.1, glob@7.2.3, inflight@1.0.6,
node-domexception@1.0.0, rimraf@2.7.1, rimraf@3.0.2, tar@6.2.1


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Migrated component and SDK test suites from Jest to Vitest, added
Vitest configs and centralized setup, and updated tests to use Vitest
APIs and matchers.
* **Chores**
  * Upgraded Storybook to 10.2.3 and simplified addons.
* Updated development dependencies and package manager entries across
packages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Fixing sass dart deprecations usage.

This Fix deprecations warnings from sass on the new dart version. 

Caveats:
- include-media uses a lot of sass if and this is deprecated, as we cant
do anything to fix it right now the warning for this deprecation only
was disabled: `if-function`
- Next uses a load sass ja api depracated, as we cant change it this
warning was also disabled `legacy-js-api`
- Before we imported the utilities in every sass file. This increased
our style as we include in some files that didnt needed it. now this is
not true anymore, any sass usage that require a utility must import it
and prefix the mixins and variables with the module name. THIS RESULTS
IN A BREAKING CHANGE FOR CLIENTS THAT PRESUME THAT UTILITIES ARE PRESENT
AT ALL TIME.

BEFORE vs AFTER

<img width="1222" height="842" alt="image"
src="https://github.com/user-attachments/assets/e371ee89-86c6-418f-8b33-138fd8c6709f"
/>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated styling system to use the Sass module/meta loader and unified
how component styles and utilities are applied, improving consistency
across responsive and utility-driven styles.
* Adjusted Sass importer behavior to improve import resolution and
suppress certain deprecation warnings.

* **Dependencies**
* Upgraded Sass and include-media; reorganized dependency vs. dev/peer
placements across packages for clearer runtime vs. development usage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Migrating to next v16 and keeping web default bundler 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
  * Build and dev scripts now explicitly use Webpack for bundling.
  * JSX transpilation updated to the React automatic runtime.
* Next.js configuration cleaned up: SWC minification, Preact aliasing,
and ESLint skip during builds removed; Turbopack root/resolution
behavior adjusted.
* Startup log now displays root folder, account ID, and analytics
status.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


[Task](https://vtex-dev.atlassian.net/browse/SFS-3073)
<img width="3440" height="1440" alt="image"
src="https://github.com/user-attachments/assets/b57277b1-54bd-404d-884a-d8af934c9e83"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
  * Added a new diagnostics package and OpenTelemetry configs (dev/prod)
* Added OpenTelemetry-related dependencies and adjusted build/config for
sourcemaps and externals

* **New Features**
  * Initialized telemetry across core and API
* Enhanced GraphQL context with trace metadata and generated request IDs
  * Wrapped resolvers to emit tracing spans

* **Tests**
  * Updated tests to await asynchronous context initialization
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
## What's the purpose of this pull request?

Removing hardcoded labels:
- #3099
- #3102 
- #3107 
- #3104 
- #3103 
- #3125
- #3131
- #3116
- #3142
- #3192

Setting Up locales
- #3141
- #3143
- #3147
- #3156
- #3162
- #3145
- #3164
- #3169
- #3171
- #3176
- #3180
- #3169
 custom path
- #3185
- #3162
- #3156
- #3170

Components
- #3093
- #3175

Fetching content 

- #3165

Others
- #3176
- #3171
- #3181
- #3189
- #3205


## How to test locally?
- Run `pnpm I` (install all the new dependencies and needed packages)
- If you want to try localization feature, go
to`/discovery.config.default.js`:
Enable localization:
```
localization: {
  enabled: true
}
```
- Run `node packages/cli/bin/run.js generate-i18n ./packages/core` to
fetch the bindings

If the contentSource is not set to content platform yet, you will see a
message to update to it.
>   contentSource: {
>     type: 'CP',
>   },

⚠️ Note: Ensure the url is set to localhost for local testing. These
locale bindings are generated in `discovery.config` after running the
generate-i18n command.

```diff
localization: {
  enabled: true,
  defaultLocale: 'en-US',
   regions: {...},
    locales: {
      'pt-BR': {
           ...
        bindings: [
          {
            currencyCode: 'BRL',
-           url: 'https://brandless.fast.store/pt-BR',
+           url: 'http://localhost:3000/pt-BR',
            salesChannel: '2',
            isDefault: true,
            locales: [
              {
                code: 'pt-BR',
                isDefault: true,
              },
            ],
          },
        ],
      },
      'it-IT': {
        ...
        bindings: [
          {
            currencyCode: 'EUR',
-           url: 'https://brandless.fast.store/it-IT',
+           url: 'http://localhost:3000/it-IT',
            salesChannel: '3',
            isDefault: true,
            locales: [
              {
                code: 'it-IT',
                isDefault: true,
              },
            ],
          },
          {
            currencyCode: 'EUR',
-           url: 'https://brandless.fast.store/europe/it',
+           url: 'http://localhost:3000/europe/it',
            salesChannel: '3',
            isDefault: false,
            locales: [
              {
                code: 'it-IT',
                isDefault: true,
              },
            ],
          },
        ],
      },
      'en-US': {
        code: 'en-US',
        name: 'English',
        languageCode: 'en',
        languageName: 'English',
        script: 'Latn',
        textDirection: 'ltr',
        regionCode: 'US',
        bindings: [
          {
            currencyCode: 'USD',
-           url: 'https://brandless.fast.store',
+           url: 'http://localhost:3000,
            salesChannel: '1',
            isDefault: true,
            locales: [
              {
                code: 'en-US',
                isDefault: true,
              },
            ],
          },
        ],
      },
    ...
}
```

- Go to /packages/core and run `npmn dev`

---------

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Co-authored-by: Leandro Rodrigues <leandro.rodrigues@vtex.com>
Co-authored-by: Otavio Moreira Meirelles <otavio.meirelles@vtex.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
## What's the purpose of this pull request?

Two small fixes: 
- migrate `middleware.ts` to `proxy.ts` to remove the Next 16
deprecation warning;
- remove locale from the product query so breadcrumb links use the
store’s default locale slugs and no longer 404 (workaround until i18n
slugs are fixed with Intelligent Search and Catalog).

## How it works?

- **Proxy**: `middleware.ts` was renamed to `proxy.ts` and the exported
function from `middleware` to `proxy`, following the Next 16 convention.
- **Breadcrumb**: `ServerProductQuery` now uses only `slug` in the
locator (no `locale`), so `breadcrumbList` returns slugs in the store’s
default locale and links no longer 404.

## References
[Task
middleware](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3076)
[Task
breadcrumb](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3077)

- [Next.js 16 – middleware to
proxy](https://nextjs.org/docs/messages/middleware-to-proxy)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Product pages: fixed 404s related to localized slugs by making product
lookup slug-only, improving reliability for translated content.

* **Refactor**
* Renamed an exported proxy entry point for clearer naming and internal
consistency (no public API behavior changed).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

When users switch locales via the Localization Selector, they are always
redirected to the home page of the new locale instead of staying on the
current page. For example, switching from pt-BR to en-US while on
/pt-BR/products/item?color=red redirects to /en-US instead of
/en-US/products/item?color=red.

## How it works?

The save callback in `useBindingSelector` previously redirected directly
to `binding.url` (the binding's base URL), discarding the current page
path and query string.
The new function `buildRedirectUrl` combines the new binding URL with
the extracted page path, preserving query strings and hash fragments.
The save callback now calls `buildRedirectUrl` with the binding URL and
the full current URL, so users stay on the same page after switching
locales.

File rename: `customPaths.ts` was renamed to `bindingPaths.ts` since the
file already contained general-purpose binding path utilities
(`matchesBindingPath`) beyond just custom paths, and the new functions
further broaden its scope. All 4 import sites and the test file were
updated accordingly.

## How to test it?

- Navigate to a page different from the home 
- Open the Localization Selector and switch to a different locale
- Verify the redirect goes to the current path with the new locale
instead of just the new locale
- Repeat with a custom-path binding 
- Verify query strings are preserved



https://github.com/user-attachments/assets/cde4d3ab-cce9-4fe2-b3aa-38bb0d546796

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-3087)
- [Slack
thread](https://vtex.slack.com/archives/C09CZGYTXEE/p1772722358790229)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* URL redirects between locales now preserve query parameters and hash
fragments, maintaining user context when switching language versions.

* **Improvements**
* Enhanced multi-locale URL path resolution for more reliable navigation
across localized content.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

Follow-up to the middleware→proxy migration: updates remaining CLI
references and fixes a flaky CI lint failure.

## How it works?

**CLI - Proxy migration**
- Renames `toggleMiddlewareByLocalizationFlag` →
`toggleProxyByLocalizationFlag`
- Uses `proxy.ts` / `proxy__DISABLED.ts` instead of `middleware.ts` /
`middleware__DISABLED.ts`

**Core - SCSS**
- `LocalizationSelector/section.module.scss`: replaces deprecated
`@import` with `meta.load-css`

**CI**
- run Lint before Build


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Refactor**
* Updated localization flag handling mechanism in CLI commands to use
proxy-based approach.
* Modernized stylesheet import syntax using Sass meta API for improved
build compatibility.

* **Chores**
  * Standardized code formatting in generated files.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

When using subdomain bindings for localization (e.g.,
`https://fr.brandless.fast.store` → `fr-FR`), the locale is correctly
identified on the initial page load but gets lost during client-side
navigation (search, PDP links, etc.), falling back to the default locale
(`en-US`). This causes two issues:

1. **Locale loss on navigation**: The session reverts to the default
locale because `matchURLBinding` doesn't recognize subdomain-only
bindings (root pathname `/`) as a match for non-root paths.
2. **Product pages return 404**: `getStaticProps` queries the GraphQL
API using the default sales channel instead of the locale-specific one,
so products exclusive to a subdomain's catalog are not found.

## How it works?

1. Subdomain binding recognition in `match-url.ts`: Added logic so that
when a binding URL has a root pathname (`/`), it's treated as a
**subdomain binding** — the hostname alone determines the locale. This
prevents the locale from being lost when navigating to paths like `/s`
(search) or `/product/p`.

2. Middleware rewriting in `proxy.ts`:
- Added a `rewriteSubdomainRequest` function that internally rewrites
requests to prepend the correct locale for subdomain domains. This
ensures `getStaticProps` receives the right `locale` parameter without
exposing it in the browser URL.
- Extended the middleware matcher to intercept `/_next/data/:path*`
requests (client-side data fetches), so locale corrections also apply
during client-side navigation.

3. Correct sales channel for locale in PDP:
- Created `getChannelForLocale(locale)` utility that resolves the
correct sales channel for a given locale by looking up its binding
configuration.
- The PDP's `getStaticProps` now passes the resolved channel in the
`locator` array, ensuring the GraphQL product query uses the
locale-specific sales channel instead of always defaulting to the
channel present in discovery.config (session.channel).

4. Link resolution fix in `useLink.ts`: Changed the default locale
reference from `storeConfig.localization.defaultLocale` to
`router.defaultLocale`. On subdomain domains, Next.js sets
`router.defaultLocale` to the domain's locale (e.g., `fr-FR`), so using
the global config default would incorrectly prepend locale prefixes to
every link.

## How to test it?

- Check that there is a subdomain binding in
`discovery.config.default.js` (e.g., `https://fr.brandless.fast.store`
for `fr-FR` with sales channel `3`)
- Access the store via the subdomain (e.g.,
`http://fr.brandless.fast.store:3000`)
- Verify the locale is correctly identified as `fr-FR` on the initial
page load
- Navigate to a search page and verify the locale remains `fr-FR`
- Navigate to a product detail page and verify:
  - The page loads correctly (no 404)
  - The product data corresponds to the correct sales channel
- The browser URL does **not** contain a locale prefix (e.g.,
`/fr-FR/product/p`)



https://github.com/user-attachments/assets/d2e18e0a-84c2-4630-870d-753bd8f13702

### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

- [Jira task](https://vtex-dev.atlassian.net/browse/SFS-3072)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Improved subdomain-based locale detection and routing, including
better handling of data routes and root-path bindings.
* Stronger locale validation and channel resolution to reduce incorrect
fallbacks and minimize unexpected 404s.
* Default-locale behavior refined to respect subdomain-specific defaults
and ensure consistent link generation.

* **Tests**
* Added tests covering locale validation, subdomain-to-locale mappings,
channel selection, and related binding logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
lemagnetic and others added 10 commits March 19, 2026 14:57
## What's the purpose of this pull request?

This applies the same hotfix as [PR
#3245](#3245): align the `after`
pagination cursor with string type (and related CMS schema updates) so
hCMS → Content Platform migrations do not hit type mismatches.

## References

- #3245

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Normalized pagination handling for ProductShelf and ProductTiles so
"after" cursors are processed consistently across the storefront.

* **Chores**
* Updated CMS configuration schemas and added foundational schema
definitions to improve content and template handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

Fix the race condition in the useLocalizationConfig hook that causes the
empty cart after refreshing the page or browsing to another page.

## How it works?

- Replaced state management for session with a ref to prevent
unnecessary re-renders.
- Updated the effect dependencies to only react to settings changes,
improving performance.
- Added logic to handle session updates without triggering re-renders,
ensuring smoother localization updates.



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Reduced unnecessary UI re-renders by changing how localization session
state is tracked and observed.
* Added a first-mount guard and streamlined session→settings
synchronization to avoid redundant updates while keeping settings
aligned with explicit locale bindings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
#3256)" (#3257)

This reverts commit 6d4e6df.

## What's the purpose of this pull request?

<!--- Considering the context, what is the problem we'll solve? Where in
VTEX's big picture our issue fits in? Write a tweet about the context
and the problem itself. --->

## How it works?

<!--- Tell us the role of the new feature, or component, in its context.
Provide details about what you have implemented and screenshots if
applicable. --->

## How to test it?

<!--- Describe the steps with bullet points. Is there any external link
that can be used to better test it or an example? --->

### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

<!--- Spread the knowledge: is there any content you used to create this
PR that is worth sharing? --->

<!--- Extra tip: adding references to related issues or mentioning
people important to this PR may be good for the documentation and
reviewing process --->

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)
## What's the purpose of this pull request?

<!--- Considering the context, what is the problem we'll solve? Where in
VTEX's big picture our issue fits in? Write a tweet about the context
and the problem itself. --->

## How it works?

<!--- Tell us the role of the new feature, or component, in its context.
Provide details about what you have implemented and screenshots if
applicable. --->

## How to test it?

<!--- Describe the steps with bullet points. Is there any external link
that can be used to better test it or an example? --->

### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

<!--- Spread the knowledge: is there any content you used to create this
PR that is worth sharing? --->

<!--- Extra tip: adding references to related issues or mentioning
people important to this PR may be good for the documentation and
reviewing process --->

## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
* Fixed data persistence initialization to prevent stored data from
being overwritten on startup
* Improved URL matching behavior for development environments and
localhost systems

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

Fix **FastStore v4 builds and codegen in monorepos** when the CLI runs
from the **repo root** and Discovery lives in a nested package
(`packages/...`): `.faststore` and subprocesses now respect the project
**`basePath`**, and **standalone** output with `outputFileTracingRoot`
at the repo root no longer breaks layouts that expect `server.js` under
`.next/standalone/`.


[SFS-3116](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3116)

## How it works?

- **`directory`**: `tmpDir` = `<basePath>/.faststore` (no longer
`cwd/.faststore`).
- **`build`**: passes `basePath` to `generate`, `cache-graphql`, and
`generate-i18n`; **`normalizeStandaloneBuildDir`** uses
`path.relative(cwd, basePath)` as a prefix when `cwd !== basePath`; -
**`dev`**: `cache-graphql` and `generate-i18n` receive `basePath`.
- **`generate-types`**: resolves paths into `.faststore` when it exists.
- **Tests**: expectations anchored to `basePath` + monorepo scenarios.

## How to test it?

### Starters Deploy Preview

## References

-
[SFS-3116](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-3116)

[SFS-3116]:
https://vtex-dev.atlassian.net/browse/SFS-3116?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SFS-3116]:
https://vtex-dev.atlassian.net/browse/SFS-3116?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved monorepo path handling so build/dev outputs, standalone
artifacts, temp dirs, and codegen respect the package base path.
* Made CLI subprocess invocations more reliable by changing how
arguments are passed (removing shell execution) and improving
package.json JSON loading behavior.

* **Tests**
* Added deterministic tests covering path resolution and monorepo
scenarios.

* **Chores**
  * Expanded exported search-related types in the SDK.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What's the purpose of this pull request?

On the PLP, when a user changes their postal code to one where certain
delivery methods (e.g. "Shipping", "Dynamic Estimate") are unavailable,
the delivery facets (Delivery Methods, Delivery Options) are not updated
— the stale filters from the previous postal code remain visible.

## How it works?

- cookieCacheBusting.ts — extend getClientCacheBustingValue() to track
postalCode alongside person.id. The resulting v query param (e.g.
v=timestamp::userId::24230220) is already appended to every GET request
URL, so this single change busts both the CDN cache and the SWR
client-side cache when the postal code changes.

- useProductGalleryQuery.ts / usePageProductsQuery.ts — add doNotRun:
isDeliveryPromiseEnabled && isSessionValidating to gate the gallery and
product queries while validateSession is in flight.

- usePageProductsQuery.ts — include _postalCode in the pagesCache
comparison key (localizedVariablesWithRegion). This is needed so the
hasSameVariables guard — which decides whether SWR is allowed to run at
all — correctly detects a postal code change and sets shouldFetch =
true. Without it, the local cache guard would permanently block the
query for an unchanged set of search params. The SSR pagesCache seed is
updated to match this shape so the first hydration render doesn't
trigger an unnecessary re-fetch.

## How to test it?

Run locally or check this
[preview](https://vendemo-cm9sir9v900u7z6llkl62l70j-mdd18ev50.b.vtex.app)
In discovery.config file:
- use `vendemo` account to test
```
  api: {
    storeId: 'vendemo',
   ..}
```
- enable deliveryPromise:
```
deliveryPromise: {
    enabled: true,
    mandatory: false,
  },
```

You should be the filters being updated after changing the postal code.

https://github.com/user-attachments/assets/bf0814e4-d863-421e-9d15-f0f8de6d87be

### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

https://vtex.slack.com/archives/C0164SHMAV9/p1776083445684739

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **New Features**
* Product queries now incorporate postal code and region information for
more location-specific results and optimized data caching.
* Enhanced session handling and request optimization for
delivery-related features.
* Cache management now simultaneously monitors authentication state and
location changes for improved accuracy.

* **Tests**
* Extended test coverage for location-aware caching across authenticated
and anonymous user scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 846366d1-5ee4-4b2a-bf1c-faf5315c1a19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/vtex-day

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hellofanny hellofanny changed the title fixes: vtex day fix: vtex day Apr 15, 2026
@codesandbox-ci

codesandbox-ci Bot commented Apr 15, 2026

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Session validation now keeps locale, currency and sales channel in
sync for a more consistent user experience.
  * Made localization settings retrieval available for integrations.

* **Chores**
  * Added diagnostic trace logging to aid debugging.
* Enabled production client-side source maps and inline source maps for
the SDK build.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Base automatically changed from canary-v2 to dev May 6, 2026 20:30
@eduardoformiga eduardoformiga force-pushed the dev branch 2 times, most recently from 6c7ef8e to 4d4ac3a Compare May 7, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants