feat(ui): Guarantee consuming-app global CSS can't distort Bible components - Shadow DOM - #348
Open
cameronapak wants to merge 2 commits into
Open
feat(ui): Guarantee consuming-app global CSS can't distort Bible components - Shadow DOM#348cameronapak wants to merge 2 commits into
cameronapak wants to merge 2 commits into
Conversation
* feat(ui)!: prototype automatic Shadow DOM isolation * docs(examples): add hostile CSS POC demo * docs(examples): clarify hostile CSS vectors * docs(ui): align shadow DOM prototype ADR * test(ui): strengthen shadow isolation proof * refactor(ui): remove shadow isolation type assertions * fix(ui): block hostile shadow host pseudo-elements * docs(ui): clarify shadow isolation trade-offs * test(ui): align shadow isolation demo conventions * docs(examples): keep hostile demo labels readable * fix(ui): use style precedence for shadow fallback stylesheet Addresses PR review feedback: the non-adoptedStyleSheets fallback rendered a bare <style> tag inside the shadow-root portal. Use React 19's <style href precedence> resource form instead so React hoists and de-duplicates the stylesheet within the shadow root rather than risking duplicate insertion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: abharms <aharms@works24.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: a794931 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
This PR is in progress and will continue to be defined. This PR was created as a feature branch for https://lifechurch.atlassian.net/browse/YPE-4113.
Greptile Summary
This proof of concept automatically renders
YouVersionAuthButtonwithin an open Shadow DOM boundary to isolate it from consuming-application CSS.Confidence Score: 5/5
The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.
No blocking failure remains.
Important Files Changed
ShadowRootHost.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Consumer[Consumer application] --> Public[YouVersionAuthButton] Public --> Wrapper[withShadowIsolation] Wrapper --> Host[Light-DOM shadow host] Host --> Root[Open shadow root] Root --> Styles{Constructable stylesheets supported?} Styles -->|Yes| Adopt[Adopt document-cached SDK stylesheet] Styles -->|No| Fallback[Render fallback style resource] Adopt --> Button[Auth button implementation] Fallback --> Button Host -. blocks host selectors .-> ButtonReviews (2): Last reviewed commit: "Merge branch 'main' into journey-to-the-..." | Re-trigger Greptile
Context used (4)