-
Notifications
You must be signed in to change notification settings - Fork 2
✨ feat(optimization): [NT-3604] Implement empty variant handling in entry resol… #359
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
Merged
Lotfi Anwar L Arif (Lotfi-Arif)
merged 15 commits into
main
from
NT-3604-handle-empty-variant-case-so-that-empty-variants-will-be-hidden-not-rendered
Jul 8, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fbd9c23
✨ feat(optimization): Implement empty variant handling in entry resol…
Lotfi-Arif 0d715dd
🔧 chore(core-sdk): Update bundle size for index.mjs to reflect new op…
Lotfi-Arif 6185abe
✨ feat(documentation, api-schemas, core-sdk): Clarify empty variant h…
Lotfi-Arif 35c1c63
🚀 ci(slack): Fixing issue with the Slack Notification script
phobetron 2ba1b87
♻️ refactor(web-sdk_angular): Align SSR with isomorphic runtime (#357)
fmamud c0800a2
🔥 feat(cda): Add managed entry fetching (#360)
phobetron 554a2bf
🐞 fix(nextjs): Fixing Next.js 15 export bug (#361)
phobetron e25bfea
♻️ refactor(web-sdk_angular): Align SSR with isomorphic runtime (#357)
fmamud 0960382
🔥 feat(cda): Add managed entry fetching (#360)
phobetron bf5a07d
🐞 fix(nextjs): Fixing Next.js 15 export bug (#361)
phobetron c8ea267
Merge branch 'main' into NT-3604-handle-empty-variant-case-so-that-em…
Lotfi-Arif 18b9a48
🔧 chore(core-sdk): Update gzip budget for index.mjs to 19100
Lotfi-Arif 711951b
🔧 chore(web-sdk): Update gzip budgets for index.mjs and contentful-op…
Lotfi-Arif 184178d
✨ feat(optimized-entry): Refactor OptimizedEntry component to improve…
Lotfi-Arif 8b88d03
🔧 chore(react-web-sdk): Update gzip budgets for index.cjs and index.m…
Lotfi-Arif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'm wondering if we can represent the variant emptiness by using a state/type property (e.g.
kind) on resolved data instead of an optional boolean flag. WDYT?For example:
Renderers become
if (resolved.kind === 'empty') return <...>, switches could became exhaustive so future outcomes surface as compile errors, andselectedOptimizationnarrows to non-optional where it's actually guaranteed.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.
I feel like that could require unexpected maintenance over time, as well as require extra logic to determine whether each is entry is of a specific type, and that type isn't always straightforward (baseline can be thought of as a variant in many cases). The current solution fix the exact case without affecting any other feature, and it's a bit of a unique case as it is. I could be wrong though.
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.
The kind discriminated union is appealing but the Experience API gives us no extra information to justify the extra variants
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.
I see, but I was thinking in a way that customers would need to know if a variant is empty or not by checking the
type/kind, otherwise no need to care about it. I feel like having a optional boolean flag a bit dubious as part of a public API.