Skip to content

feat: add mostly transparent RSC support - #5620

Merged
quantizor merged 10 commits into
mainfrom
rsc
Jan 10, 2026
Merged

quantizor merged 10 commits into
mainfrom
rsc

Conversation

@quantizor

@quantizor quantizor commented Dec 21, 2025 •

Copy link
Copy Markdown
Contributor

Adjust library to function properly under RSC by conditionally bypassing some hook usage. Normally conditional use of hooks is a no-no, but the final behavior is deterministic per runtime environment.

Also adds trusted publishing and fixes #5608

@changeset-bot

changeset-bot Bot commented Dec 21, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 835bd16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
styled-components Minor

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

@quantizor

Copy link
Copy Markdown
Contributor Author

This PR is available at styled-components@prerelease for testing.

@quantizor

Copy link
Copy Markdown
Contributor Author

If you are interested in RSC support, please test the build and react to #5624

- Add .npmrc with pnpm configuration
- Update root and package package.json files for pnpm workspace
- Update GitHub Actions workflows to use pnpm
- Update CONTRIBUTING.md and README.md with pnpm instructions
- Remove .yarn/releases/yarn-4.12.0.cjs
- Remove .yarnrc.yml
- Remove yarn.lock
- Detect RSC environments via typeof React.createContext check
- Output inline <style> tags with React 19 precedence attribute in RSC mode
- Make ThemeProvider and StyleSheetManager no-ops in RSC (pass-through children)
- Add runtime guards for conditional React hook access
- Update exports to support RSC-safe imports
- Add changeset documenting RSC support and best practices
- Add modern HTML5 elements (dialog, details, summary, etc.)
- Add SVG elements for better SVG support
- Improve element coverage for comprehensive DOM element styling
- Extend CSSProperties interface to accept CSS variable names (--*)
- Allow string index signature for custom properties
- Update type tests to verify CSS variables work correctly
- Add Server Component test page with ServerTestWrapper
- Add ServerTestControls for dynamic component loading
- Migrate sandbox to Next.js App Router
- Remove old Pages Router files
- Update sandbox configuration for App Router support
- Add AGENTS.md with codebase file map and rendering flow diagrams
- Document RSC best practices in FAQ (data attributes, CSS variables)
- Show CSS custom property cascading as ThemeProvider alternative
- Update checkDynamicCreation to handle edge cases
- Add pnpm-lock.yaml with lockfile version 9.0
- Add pnpm-workspace.yaml to define workspace structure
@quantizor
quantizor merged commit aef2ad6 into main Jan 10, 2026
@quantizor
quantizor deleted the rsc branch January 10, 2026 08:24
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.

domElements missing <search> tag (styled.search)

2 participants