Repository navigation
Conversation
* Updates RadioProps to add FSUI props Co-Authored-By: Eduardo Formiga <[email protected]> * Tweaks `Checkbox` token list order Co-Authored-By: Eduardo Formiga <[email protected]> Co-authored-by: Eduardo Formiga <[email protected]>
* Undo a6ce7c5 vtex-sites/nextjs.store@a6ce7c5 * Apply cc35ff8 vtex-sites/gatsby.store@cc35ff8 * Fix `SearchHistoryProps` type export * Fix warnings from `import/no-anonymous-default-export` https://github.com/vtex-sites/nextjs.store/runs/6698228942 ``` ./src/components/search/History/SearchHistory.stories.tsx 4:1 Warning: Assign object to a variable before exporting as module default import/no-anonymous-default-export ./src/components/search/Suggestions/SuggestionsTopSearch.stories.tsx 4:1 Warning: Assign object to a variable before exporting as module default import/no-anonymous-default-export ./src/components/ui/Search/Suggestions/Suggestions.stories.tsx 37:1 Warning: Assign object to a variable before exporting as module default import/no-anonymous-default-export ``` * Fix `fs-link` CSS specificity Having the attribute selector made it harder for other components to overwrite the link styles, e.g., in the links inside the search input dropdown. This fixes it. * Add entries to the change log
## How does it work? I had tried using a new feature from React 18 called `useDeferredValue` but got a type error `Module '"react"' has no exported member 'useDeferredValue'.`. I started by [updating the type definitions from 17.x to 18.x](vtex-sites/nextjs.store@8955ce3) but got another [type error with `HelmetProvider`](https://github.com/vtex-sites/nextjs.store/runs/6828783453). I was able to [remove it](vtex-sites/nextjs.store@eb0f3f9) as it was not really needed, but the build failed again in the next [type error in `ErrorBoundary`](https://github.com/vtex-sites/nextjs.store/runs/6828844458). Finally, after [adjusting the missing type](vtex-sites/nextjs.store@c5fbda5), I got everything working and with support for React 18 types. ## How to test it? Try to use any new React 18 features and their types should not fail to compile the build.
* Refactors `Link` to handle both external and internal links * Refactors `ButtonLink` to work with local `Link` component instead Next's `Link` * Prefers `data-fs-link` data attribute usage * Removes common `Link` component * Unifies `Link` usage * Minor spacement fix * Adds changelog entry * Removes unnecessary `disabled` prop * Improves external link checker by memoizing it * Checks if is a internal link instead for external for the sake of performance * Adds `onClick` event type
## What's the purpose of this pull request? Upgrade Storybook to keep it up to date. ## How does it work? Just ran the recommended command `npx sb upgrade`. Output for this command: ``` WARN Found 23 outdated packages (relative to '@storybook/[email protected]') WARN Please make sure your packages are updated to ensure a consistent experience. WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] WARN - @storybook/[email protected] 🔎 checking possible migrations.. attention => Storybook now collects completely anonymous telemetry regarding usage. This information is used to shape Storybook's roadmap and prioritize features. You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: https://storybook.js.org/telemetry Found builder webpack5, skipping Unable to find .eslintrc config file, skipping ✅ migration check successfully ran exec: 4:27.921 (m:ss.mmm) remove temp package: 7.008s ypx: 6:18.097 (m:ss.mmm) ``` ## How to test it? Test the Storybook [deploy preview link](https://nextjs-store-storybook-git-chore-storybook-upg-ae61b4-faststore.vercel.app/). ## References - Storybook's [CHANGELOG](https://github.com/storybookjs/storybook/blob/33bf40e53140cba69e6fbf6489d5072b4661f5f4/CHANGELOG.md).
* Creates dropdown components * Starts to add dropdown tokens * Adds Icon prop tp dropdown item and adjusts tokens * Adds small size variant * Adds missing bottom border * Adjusts dropdown item height * Replaces dropdown on breadcrumb component * Updates dropdown stories * Adjusts position for specific icon * Uses rem instead of px * Adds tokens tables * Adds accessibility keyboard section * Adds stories for Dropdown Item and Menu * Removes icon variant from dropdown item * Updates components description * Replaces for images examples * Updates changelog * Updates changelog * Removes unnecessary max-width * Removes unused import and classes * Updates images links * Removes unused id
* Adds CSS Modules to empty state * Creates EmptyState along with related components stories * Adds CHANGELOG entry * Update src/components/cart/EmptyCart/EmptyCart.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Update src/components/ui/EmptyState/empty-state.module.scss Co-authored-by: Fanny Chien <[email protected]> * Update src/components/ui/EmptyState/EmptyState.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Changes template message Co-authored-by: Fanny Chien <[email protected]> * Removes divider for first sections on stories * Update src/components/ui/EmptyState/EmptyState.stories.mdx Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
* Tweaks token name and space * Adds CHANGELOG entry * Update src/components/cart/EmptyCart/EmptyCart.stories.mdx Co-authored-by: Filipe W. Lima <[email protected]> * Update src/components/sections/ProductGallery/EmptyGallery.stories.mdx Co-authored-by: Filipe W. Lima <[email protected]> * Trigger CI Co-authored-by: Filipe W. Lima <[email protected]>
* Aims to show use cases instead of Related Components section * Adds CHANGELOG entry * Trigger CI * Trigger CI * Trigger CI
* Adds missing dropdown button data attr * Updates dropdown button data attr * Updates breadcrumb stories * Fixes typo * Updates changelog * Changes export default
## How does it work? See vtex-sites/gatsby.store#67 for more details. ## How to test it? Because the intelligent search's top search data comes from [real usage data from the last 14 days](https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4gXFsEWjF7QF7UtI2GAvhL#:~:text=Section%20information%20Most%20searched%20terms%20and%20Search%20suggestions%20are%20updated%20daily%20using%20the%20data%20from%20the%20last%2014%20days%20of%20the%20customers%27%20interaction%20with%20the%20search.), as of today, we don't have any top search data to show for the **storeframework** store ID. That means the preview deploy won't display the Top Search component with data. Because of that, and for testing purposes, I've created a temporary branch where I switched the store ID for **storecomponents**, it has top search data and you can preview it working in [this preview deploy](https://sfj-0256cc7--nextjs.preview.vtex.app/).  ## Known Issues - The [Storybook's `TopSearch` storie](https://nextjs-store-storybook-git-feat-search-history-n-top-faststore.vercel.app/?path=/docs/organisms-search-topsearch--default) is not loading data correctly and will be fixed in a later PR.
* Replaces `@storybook/addon-docs/blocks` Importing from '@storybook/addon-docs/blocks' is deprecated. https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-scoped-blocks-imports * Adds and customizes viewport addon * Disables some addons * Displays toolbar by default * Renames Canvas and changes its position * Replaces `@storybook/addon-docs/blocks` * Adds minor change to css * Attempts to reorder tabs * Avoids onChange handler errors on console * Adjusts disable prop * Hides toolbar on fundamentals docs * Adds callout about sandbox tab * Changes callout icon to bulb * Updates changelog
* feat: add tokens to RegionalizationBar Signed-off-by: Arthur Andrade <[email protected]> * feat: Add RegionalizationBar docs Signed-off-by: Arthur Andrade <[email protected]> * chore: Add changelog Signed-off-by: Arthur Andrade <[email protected]> * Fixes Storybook addon-docs warnings * Removes Stories for `RegionalizationBar` * Creates Regionalization stories * Fixes typo * Fixes typo * Improves Regionalization import text Co-authored-by: Fanny Chien <[email protected]> * Fixes typo Co-authored-by: Fanny Chien <[email protected]> * Fixes import text * Improves Regionalization doc page * Updates Regionalization Bar tokens title Co-authored-by: Fanny Chien <[email protected]> * Creates `RegionalizationBar` doc page and simplifies its tokens * Moves `RegionalizationButton` styles to navbar * Improves Regionalization doc * Fixes Doc links * Improves copy Co-authored-by: Fanny Chien <[email protected]> * Fixes regionalization tokens Co-authored-by: Fanny Chien <[email protected]> * Improves `RegionalizationBar` tokens * Updates `Regionalization` Overview page with `Modal` * Updates Changelog * Fixes `Regionalization` story links * Fixes "See More" button on `Modal` story Co-authored-by: Arthur Andrade <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
* Removes unused icons file * Removes unnecessary data-attr * Adds default stories mdx * Renames data-store-image to data-fs-image * Moves image styles to layout.scss * Adjusts tokens for image-gallery * Renames `data-thumbnail-button` to `data-fs-image-gallery-selector-thumbnail` * Adds `data-fs-image-gallery-selector-control-button` data-attr` * Adds image-gallery-selector-elements tokens * Adds tokens data-fs-image-gallery-selector-thumbnail data-attr * Adds tokens documentation * Removes unused args paramenter * Convert px to rem * Updates title * Adds `-mobile` * Updates description * Updates changelog * Updates tokens variables with global tokens * Renames thumbnail selected border color token * Adding Variants section * Reorders Variants section place
* Adds CSS Modules to Accordion * Adds Accordion theming tokens * Adds Changelog Entry * Moves styles to accordion component * Creates Accordion stories * Adds Accordion stories * Updates Accordion stories Co-authored-by: Fanny Chien <[email protected]> * Update src/components/ui/Accordion/Accordion.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Update src/components/ui/Accordion/AccordionItem.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Update src/components/ui/Accordion/Accordion.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Updates token value * Updates AccordionItem link * Adds spaces to tokens * Update src/components/ui/Accordion/accordion.module.scss Co-authored-by: Fanny Chien <[email protected]> * Tweaks style comment * Update src/components/ui/Accordion/Accordion.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Update src/components/ui/Accordion/Accordion.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Adds padding bottom to Accordion item panel * Links only Accordion on stories * Renaming tokens * Adds variants section * Improves compound components section * Displays one item expanded * Adds Overview section on Accordion Item * Adds link to AccordionItem * Adjusts Accordion Item description * Updates tokens names * Updates doc * Removes `--fs-accordion-item-button-width` token Co-authored-by: Fanny Chien <[email protected]>
* Fixes Best Practices section * Creates `ProductGrid` tokens * Creates ProductGrid doc Co-Authored-By: Eduardo Formiga <[email protected]> * Updates Changelog * Fixes `ProductGrid` description typo Co-authored-by: Lucas Feijó <[email protected]> * Hides props that are not working for now * Improves BestPractices descriptions Co-authored-by: Eduardo Formiga <[email protected]> Co-authored-by: Lucas Feijó <[email protected]>
* Adds new tokens and applies CSS modules to `Tiles` * Removes `Tiles` css imports * Renames `ProductTiles` interface and uses new `Tile` data attribute * Adds changelog entry * Adds `Tiles` story * Uses default variant for `ProductCard` * Improvements on description and usage section * Minor token improvements * Removes extra section padding * Minor improvements * Adds `Callout` storybook component * Trigger CI with an empty commit * Adds overflow value for each `Tile`; Story improvements
* Extracts FilterSlider components and uses CSS Modules and tokens * Adds CSS Modules to Accordion * Adds Accordion theming tokens * Adds Changelog Entry * Moves styles to accordion component * Creates Accordion stories * Adds Accordion stories * Adds tokens to facets * Adds tokens to Filter Slider * Creates Filter Stories * Removes unused imports from Filter stories * Adds Filter facet description * Creates facets stories * Removes unused import from facets stories * Crestes FilterSlider stories * Adds CHANGELOG entry * Updates Filter related stories with PriceRange changes * Updates Filter related components links on storybook * Update src/components/search/Filter/Facets.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Fixes merge glitch * Fixes `Filter` Overview doc naming * Improves `Filter` Overview doc page * Creates `SectionList` Storybook component * Improves `Facets` and `FilterSlider` doc pages * Adds extra links for Related Components * Adds components links * Disable control for facets stories * Disable controls for FilterSliders stories * Update src/components/search/Filter/Filter.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Update src/components/search/Filter/Filter.stories.mdx Co-authored-by: Fanny Chien <[email protected]> * Update src/components/search/Filter/Filter.stories.mdx Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: renatamottam <[email protected]>
* Adjusts tokens breakpoints name * Adds CHANGELOG entry * Tweaks token border width * Update CHANGELOG.md Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
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. Latest deployment of this branch, based on commit de3c30f:
|
eduardoformiga
force-pushed
the
add-core
branch
from
February 7, 2023 21:55
9d9d9df to
e2ceea2
Compare
eduardoformiga
force-pushed
the
add-core
branch
from
February 8, 2023 14:28
afd4ca7 to
e2ceea2
Compare
eduardoformiga
force-pushed
the
add-core
branch
from
February 8, 2023 15:35
36097c5 to
429444e
Compare
eduardoformiga
approved these changes
Feb 8, 2023
## What's the purpose of this pull request? This PR adds missing components on `fs/core`: - [x] ProductCard - [x] PaymentMethods ## How it works? It should all works as before (visually). ## How to test it? Run `yarn dev` and check `ProductCard` and `PaymentMethods` (footer) components on the store. --------- Signed-off-by: Arthur Andrade <[email protected]> Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Guilherme Carvalho <[email protected]> Co-authored-by: Filipe W. Lima <[email protected]> Co-authored-by: Arthur Andrade <[email protected]>
renatamottam
approved these changes
Feb 10, 2023
ArthurTriis1
approved these changes
Feb 10, 2023
hellofanny
added a commit
that referenced
this pull request
Sep 14, 2026
## What A pre-emptive guard: `onErrorRetry` never retries a `429`, and reproduces SWR's default for every other status. This is the v4 half of the crawler/bot traffic work. The status-legibility half already shipped on `dev` via #3379, so this PR touches only the client retry policy. The `3.x` counterpart — which needs both halves, since v3's BFF still reports upstream `429`s as `500` — is #3420. ## Why An upstream `429` means a VTEX service (Session Manager, checkout, Intelligent Search) is already shedding load against a per-account rate limit. Retrying it multiplies exactly the traffic that upstream is trying to reject, so the correct client policy is to never retry it. `DEFAULT_OPTIONS` asks for retries on every status (`errorRetryCount: 3`, `shouldRetryOnError: true`). The moment those retries actually run, a `429` would be retried 3× along with everything else. This PR makes sure that never happens. > An earlier version of this description attributed a documented incident's amplification (11,512 distinct product requests becoming roughly 20k) to those SWR retries. **That attribution was wrong** — see *Status* below. The policy is still correct; only its justification changed. ## Status: this policy is inert today Worth stating up front, because it changes how the PR should be read. `useQuery`'s fetcher never lets a rejection reach SWR: ```ts fetcher: () => new Promise((resolve) => { setTimeout(async () => { resolve(await request(...)) // a rejection is dropped here }) }) ``` If `request()` rejects, the `await` throws inside the `async` callback, `resolve` is never called, and the outer promise stays pending forever. SWR never sees an error, so `onErrorRetry`, `errorRetryCount` and `shouldRetryOnError` have never taken effect — that config has been in `DEFAULT_OPTIONS` since the commit that created `@faststore/core` (#1629), alongside this same fetcher. What follows from that: - **No client retry amplification exists today**, on either branch. The incident's request volume has other causes — chiefly the per-page-view fanout of `ValidateSession` and `ValidateCartMutation`, which are uncacheable POST mutations that never touch SWR. - **This PR changes no observable behavior right now.** - **It is still worth landing.** It is correct, pinned by tests against [email protected]'s default, and in place *before* the fetcher fix makes retries live — so a `429` is never amplified during that transition. Landing the guard first is what removes the window where retries would be live for `429` too. Full analysis, with the re-derived incident numbers and the verification, is in [this comment](#3453 (comment)). ## How `onErrorRetry` returns early on `error.status === 429`, and otherwise reproduces SWR's default. The important subtlety: **supplying `onErrorRetry` replaces SWR's default implementation entirely — it does not compose with it.** A bare predicate would have silently dropped the `errorRetryCount` ceiling and the jittered exponential backoff for every other status. The fall-through branch therefore mirrors [email protected]'s default, and the tests pin that behavior so a future SWR upgrade surfaces any drift. `3.x` mirrors [email protected]; the default `onErrorRetry` is identical in both versions, so the two branches carry the same policy. The truncation is written as `Math.trunc` rather than SWR's `~~` (Sonar flags the doubled bitwise operator). The jitter stays far below 2^31, where the two are equivalent, so the timings are unchanged. ## Tests New `packages/core/test/sdk/graphql/retryPolicy.test.ts` (18 cases): - `429` schedules no revalidation - `400`, `401`, `403`, `404`, `409`, `422`, `500`, `502`, `503` and status-less errors still retry - the `errorRetryCount` ceiling still applies (retries at the limit, stops past it) - backoff timings match SWR's, including the exponent cap at 8 Full `packages/core` sdk suite passes (255 tests). Because the policy is unreachable in production today (see *Status*), these tests are what actually exercise it — they call `onErrorRetry` directly rather than through `useQuery`. ## Follow-ups (not in this PR) 1. **The fetcher.** The dropped rejection is a real bug independent of `429`: today any query error leaves the component loading forever, with no error state. It needs its own PR, because fixing it switches on an error path that has never executed. Two consumers use `suspense: true`, where a rejecting fetcher throws to the nearest boundary even with retries enabled; the global `ErrorBoundary` answers an uncaught error with a hard `window.location.href = '/500'`, which is itself a fresh page load firing two more uncacheable mutations. Where the boundaries belong, and whether 3 retries for `5xx` is the default we want, are decisions that deserve a dedicated review. 2. **The validation fanout.** `ValidateSession` and `ValidateCartMutation` fire once per page load, unconditionally, **including with an empty cart**. In the incident's one occurrence with a per-operation breakdown they are 13,116 and 9,545 requests against 2,866 product queries. An empty-cart gate would remove most of the second, taking care to preserve the sales-channel sync `validateCart` also performs. 3. **Spec and RFC correction.** Both attribute the amplification to SWR retries and should be updated, along with the RFC's G3, which is already satisfied today. ## Notes - No behavior change today for any status (see *Status*); once retries are live, no behavior change for any status other than `429`. - The `401` / refresh-token recovery is an explicit path in the session SDK, not SWR-retry-driven, so it is unaffected. - No API surface or schema change. ## Spec `specs/crawler-bot-traffic-resilience/spec.md` — Phase 0b. Derived from the crawler/bot traffic resilience RFC. Note that FR-7 is satisfied as written, but the spec's "bot burst becomes a non-event" scenario names `ValidateSession`/`ValidateCartMutation` — operations this policy cannot reach, since they do not go through SWR. See follow-up 3. Made with [Cursor](https://cursor.com) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved GraphQL request retries with jittered exponential backoff. * Requests receiving HTTP 429 responses no longer retry automatically. * Retry attempts now respect configured limits and use a maximum backoff interval. * Retry timing is now more consistent and resilient during temporary request failures. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's the purpose of this pull request?
Adds core project as package (nextjs.store) and keep commits.
Updates Vercel previews (storybook, site doc (nextra) and store preview- app/site - nextra- core storybook - (older nextjs.store storybook).- core preview - the store.How it works?
How to test it?
Starters Deploy Preview
References