Skip to content

fix: use uiContainer to apply position when creating shadow root ui - #2036

Merged
aklinker1 merged 2 commits into
wxt-dev:mainfrom
namuorg:fix-shadow-root
Feb 9, 2026
Merged

aklinker1 merged 2 commits into
wxt-dev:mainfrom
namuorg:fix-shadow-root

Conversation

@namuorg

@namuorg namuorg commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

See #1939 for the original PR and discussion (I didn't realize that deleting my fork would automatically close the existing PR for this)

@netlify

netlify Bot commented Jan 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit ee507e4
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/69897ed00ef34a000895eba8
😎 Deploy Preview https://deploy-preview-2036--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@PatrykKuniczak

Copy link
Copy Markdown
Collaborator

@aklinker1 This is acceptable?
Because last year, you want him to implement flag instead of change it to uiContainer

@namuorg

namuorg commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@aklinker1

To summarize the context here since it's been a few months: This is a companion PR to aklinker1/webext-core#118 which fixes @webext-core/isolated-element incorrectly creating a full HTML document when setting up the shadow DOM.

This seemed to have been originally done in order to work around Tailwind not properly supporting the shadow DOM, but this was fixed upstream so we can set up the shadow DOM properly as a fragment of the DOM tree. Comment about the Tailwind fix here: aklinker1/webext-core#118 (comment)

@aklinker1 aklinker1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is fine to merge, uiContainer is the same element as shadow.querySelector('html').

@aklinker1

aklinker1 commented Feb 9, 2026 •

Copy link
Copy Markdown
Member

Just left a comment over there: aklinker1/webext-core#118 (comment)

I'm fine with switching to fragments if it's a breaking change to both wxt and @webext-core/isolated-element. Will just need a PR on WXT once the new version of isolated element is released.

@aklinker1
aklinker1 enabled auto-merge (squash) February 9, 2026 06:30
@pkg-pr-new

pkg-pr-new Bot commented Feb 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2036

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2036

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2036

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2036

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2036

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2036

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2036

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2036

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2036

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2036

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2036

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2036

wxt

npm i https://pkg.pr.new/wxt@2036

commit: ee507e4

@codecov

codecov Bot commented Feb 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.96%. Comparing base (d4267af) to head (ee507e4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2036      +/-   ##
==========================================
+ Coverage   75.89%   75.96%   +0.06%     
==========================================
  Files         113      113              
  Lines        3041     3041              
  Branches      682      682              
==========================================
+ Hits         2308     2310       +2     
+ Misses        649      648       -1     
+ Partials       84       83       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1
aklinker1 merged commit 26b7927 into wxt-dev:main Feb 9, 2026
17 checks passed
@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for helping make WXT better!

@namuorg
namuorg deleted the fix-shadow-root branch February 9, 2026 06:38
@aklinker1

aklinker1 commented Feb 9, 2026 •

Copy link
Copy Markdown
Member

This PR is fine to merge, uiContainer is the same element as shadow.querySelector('html').

Ah, wait, that's not true. We return the body for isolatedElement... https://github.com/aklinker1/webext-core/blob/a62279700692f548adde8f504e5013084b70caaf/packages/isolated-element/src/index.ts#L107

Gonna revert, we need to make this change in the breaking change PR, not a normal one.

Edit: Done 2c57840

@aklinker1

Copy link
Copy Markdown
Member

Next steps for getting this added back are noted here: aklinker1/webext-core#128

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.

3 participants