Skip to content

#772 Improve Browser Support for new components - #816

Merged
NoelDeMartin merged 7 commits into
SolidOS:stagingfrom
NoelDeMartin:772-browser-support
Jun 30, 2026
Merged

#772 Improve Browser Support for new components#816
NoelDeMartin merged 7 commits into
SolidOS:stagingfrom
NoelDeMartin:772-browser-support

Conversation

@NoelDeMartin

@NoelDeMartinNoelDeMartin commented Jun 24, 2026

Copy link
Copy Markdown
Member

This PR aligns the features used in the new components with our target browsers, in particular:

  • Removes :state() usage.
  • Removes CSS anchor positioning usage.
  • Removes popover usage.
  • Tweaks <dialog> usage. It is supported by almost all our target browsers, but it should be "usable" for the 0.01% that don't.

It also improves a11y for the Combobox component, and cleans up some Vite and package.json configs.

- Update dependencies range to dev prereleases
- Move tailwindcss to devDependencies (reset CSS is bundled in dist)
- Remove React dependencies (no longer needed for Storybook 10)
@NoelDeMartin
NoelDeMartin changed the base branch from main to stagingJune 24, 2026 15:26
@NoelDeMartinNoelDeMartin self-assigned this Jun 24, 2026
@NoelDeMartin
NoelDeMartin marked this pull request as ready for review June 25, 2026 11:48

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves cross-browser compatibility for Solid UI components and build outputs by removing reliance on newer/less-supported platform features (Popover API, :state() selectors, direct FS copy/write steps) and consolidating build-time Babel behavior into solidos-toolkit.

Changes:

  • Replace local Vite Babel plugin with solidos-toolkit/vite and centralize Lit decorator path configuration.
  • Improve runtime browser support by updating component behavior (Combobox popup implementation, Dialog showModal() guard, :state()data-state-*).
  • Make build artifacts more bundler-native via emitFile() (CSS d.ts + CDN legacy alias generation).

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
vite.config.mtsSwitch Babel integration to solidos-toolkit/vite and pass Lit decorator paths.
vite-config/styles.tsEmit theme.css.d.ts via Rollup asset emission instead of writing to disk.
vite-config/components.tsIntroduce litDecoratorPaths configuration used by Babel plugin.
vite-config/cdn.tsUse solidos-toolkit/vite Babel + change legacy alias generation from FS copy to bundle emission.
vite-config/babel.tsRemove the repo-local Babel plugin implementation.
tsconfig.jsonInclude .storybook/**/* in TypeScript compilation scope.
src/lib/components/web-component/WebComponent.tsReplace ElementInternals state toggling with data-state-* attributes for broader CSS support.
src/lib/components/traits/InputTrait.tsAdd stable label id for improved ARIA wiring.
src/components/dialog/Dialog.tsGuard showModal() usage for browsers without support.
src/components/dialog/Dialog.styles.cssRemove closed-dialog display:none override.
src/components/dialog-provider/DialogProvider.tsMore reliable slot lookup via querySelector('slot').
src/components/combobox/Combobox.tsReplace Popover API usage with wa-popup and implement keyboard/mouse open/selection logic + ARIA.
src/components/combobox/Combobox.styles.cssStyle wa-popup and update listbox/active option styling.
src/components/avatar/Avatar.styles.cssUpdate state styling to data-state-* selectors.
src/components/account/Account.styles.cssUpdate state styling to data-state-* selectors.
package.jsonDependency adjustments (introduce solidos-toolkit, move/update versions).
package-lock.jsonLockfile updates reflecting dependency and transitive changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/components/combobox/Combobox.ts Outdated
Comment threadsrc/components/combobox/Combobox.ts Outdated
Comment threadsrc/components/dialog/Dialog.ts
Comment threadvite-config/cdn.ts
@NoelDeMartinNoelDeMartin linked an issue Jun 25, 2026 that may be closed by this pull request
NoelDeMartinand others added 4 commits June 25, 2026 17:31
- Reuse babel config from solidos-toolkit
- Replace closeBundle usage with generateBundle emits
- Fix storybook TS config
- Use bundler module resolution
Only 0.01% of our target browsers don't support it (KaiOS and Opera Mini), so it's not worth adding any polyfills. However, these changes make it at least usable on these browsers given that a <dialog> will be rendered as a plain unknown element instead of crashing.
Prompts:
- Looking at https://github.com/shoelace-style/webawesome/blob/next/packages/webawesome/src/components/select/select.ts, can you update the Combobox component to be accessible? Also, replace the popup and anchor CSS positioning by using Web Awesome's popup instead (wa-popup).
- Can you review the ARIA guidelines for our current implementation? https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
AI Summary of the work:
- Replaced native popover and CSS anchor positioning with wa-popup
- Added combobox ARIA roles, states, and keyboard navigation
- Aligned aria-selected, labeling, and keyboard behavior with APG guidelines
- Close popup on outside click or focus, Escape, Tab, and empty filter results
- Added label ids in InputTrait for aria-labelledby
Co-Authored-By: Cursor <cursoragent@cursor.com>

@timea-solidtimea-solid 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.

Looks ok to me.

@NoelDeMartin
NoelDeMartin merged commit 98b9132 into SolidOS:stagingJun 30, 2026
9 checks passed
Sign up for freeto 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.

Review a11y for design system and primitive Web Components Improve Browser Support for design system and primitive Web Components

3 participants

@NoelDeMartin@timea-solid