Repository navigation
feat: allow the sections to be returned in an optimized JSON format. - #8
Closed
marcoferreiradev wants to merge 31 commits into
Closed
marcoferreiradev wants to merge 31 commits into
marcoferreiradev wants to merge 31 commits into
Conversation
…shtoken/webstore” in refreshToken and setLoginCookies.
… actions; streamline session management
…ate cookie management for sign-in and logout
…icated due to the deco's native segment
…es' to defaultItems
…ession type instead of GetSessionResponse
…ateSession on successful auth status
- Replace boolean `ignoreStructuredData` with explicit `structuredDataControl` options - Fix bug where bots still received JSON-LD even when `ignoreStructuredData=true` - Add "always include" (default), "disable for users", and "disable for all" modes - Deprecate `ignoreStructuredData` with backward compatibility - Extract shared logic to `shouldIncludeStructuredData` utility
…y and clarity in Logout.tsx
* feat(proxy): add prop to exclude entries from final sitemap * feat(vtex-proxy): make possible to add custom handlers to proxy --------- Co-authored-by: Pedro Bernardina <pedro.guidance@gmail.com>
Co-authored-by: Pedro Bernardina <pedro.guidance@gmail.com>
classic/setpassword now requires the session minted by POST /authentication/startlogin (sent via the _vss cookie); the older GET /authentication/start token passed in the request body is rejected with an empty-body HTTP 500 on VTEX ID Authenticator-migrated accounts, breaking password change. Switch resetPassword to the startlogin flow used by vtex.react-vtexid and FastStore useSetPassword (startlogin -> _vss cookie -> setpassword?expireSessions=true, no authenticationToken in the body). Add startlogin + expireSessions to the VTEXCommerceStable client type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
VTEX returns auth rejections (WrongCredentials, BlockedUser) from setpassword as a non-2xx whose body is a valid AuthResponse. fetchSafe wrapped that in an HttpError, so resetPassword/recoveryPassword bubbled it up and the client choked on a JSON.parse SyntaxError — showing a broken/generic screen instead of the real message ("Senha atual incorreta").
Catch the HttpError, recover the AuthResponse via authResponseFromHttpError, and return it so the client maps it to a message. Unexpected failures are logged and rethrown as a typed HttpError. Guard validateSession so a post-success session failure isn't mistaken for a password-change failure.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fresh.ts gains a structured-JSON exit alongside the existing ?asJson one:
?renderJson (legacy alias ?appJson — remove once consumers switch) resolves
the page with hooks that short-circuit sections opted out of JSON rendering
(their loaders never run), serializes the tree via @deco/deco
serializeResolvedSection honoring each section's `renderJson` export, and
responds { name, path, sections } with lazy sections as
{ component, lazyUrl } placeholders. One-shot JSON responses never use
async render (firstByteThreshold guards extended); renderJson takes
precedence when both params are sent; legacy ?asJson is untouched.
The website app gains `renderJson.sectionsToIgnore` (admin-configurable):
app-owned sections excluded by resolveType suffix — site-owned sections
should prefer `export const renderJson = false` in their own file.
Replaces the site-level wrapper pattern (handler + pages-loader fork) that
oficina-reserva ran as v1 — the default website/loaders/pages.ts now works
unchanged for renderJson consumers.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The fresh.ts renderJson branch imports symbols (sectionModuleLookup, serializeResolvedSection, computeRenderCb) that only exist in our runtime fork — upstream jsr:@deco/deco doesn't have them, so standalone deno check broke. Raw URLs don't resolve subpaths via the package exports map, hence one entry per subpath used, plus @deco/deno-ast-wasm which the runtime graph self-references. Pre-existing vtex/mod.ts type-constraint errors remain untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tagging OptionsShould a new tag be published when this PR is merged?
|
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 is this Contribution About?
Please provide a brief description of the changes or enhancements you are proposing in this pull request.
Issue Link
Please link to the relevant issue that this pull request addresses:
Loom Video
Demonstration Link