Repository navigation
fix: harden 6.7.0 packaging, RSC stylis cache, and client-reference Proxy handling - #5895
Conversation
|
| Name | Type |
|---|---|
| styled-components | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
There was a problem hiding this comment.
ℹ️ No critical issues — one minor documentation suggestion inline.
Approach: sound — each fix targets the mechanism that produced the defect (memo keys written only after the stylis instance builds, client-reference detection moved ahead of every trap-prone probe, the tarball narrowed to the subpath entry it actually needs) rather than the symptom.
Reviewed changes
- Published tarball —
filesnow listsnative/distandnative/package.jsoninstead of the wholenative/directory, so the workspace-installednative/node_modulesno longer ships; a newnpm pack --dry-runtest locks the contents. - Duplicate native declarations — the native rollup config uses
basePluginsinstead ofcommonPlugins, dropping the second declaration emitter that wrotenative/dist/dist/**, andprebuildclearsnative/dist. configureServerStyles— moved frombase.tstoindex.ts, so the standalone UMD entry no longer carries the browser stub; treeshake assertions cover all three bundle families.- RSC stylis memo —
nextStylisis built before any memo key is written and the options-only branch no longer overwrites the shared cache, so a throwing plugin keeps throwing instead of reusing a previous request's instance. - Client-reference proxies —
flattenchecksisClientReferencebefore the brand/keyframes/plain-object probes, the dev-modeComponentStylecheck skips client references, andhasStyledComponentBrandrequires a non-empty string id whileisStyledComponentkeeps React Native's boolean brand. - CI, docs, workspace —
pnpm check:type-resolutionadded to the test job;AGENTS.mdanddocs/rsc-style-injection.mdaligned with the per-gate server detection andstylisPlugins={[]}behavior; expired[email protected]release-age exclusions removed.
Verified at 34c4afb5: full web suite (1040), native suite (45), pnpm --filter styled-components build including test:build (40, with the new packaging block), tsc --noEmit, prettier, and pnpm check:type-resolution with and without dist. Reverting the native rollup plugin list to ...commonPlugins regenerates native/dist/dist/** and fails the new tarball test, so it genuinely guards that regression.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Only one commit landed since the prior Pullfrog review, and it is documentation-only:
- Brand-shape JSDoc —
isStyledComponentandhasStyledComponentBrandnow state that the stringstyledComponentIdis the web brand whiletrueis React Native's (no class selector), and why flatten must not accept the boolean form. The claims match the code:StyledNativeComponent.tsbuilds viaReact.forwardRefand setsstyledComponentId = true, andflattenroutes throughhasStyledComponentBrand, so the described.truehazard is real. No behavior changed (+7/−4, comments only).
The one prior review thread (missing explanation of the boolean brand) is addressed by this commit and resolved.
ℹ️ GitHub took this as a comment because it requires explicit repository access to approve or block a pull request here.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Pre-release hardening pass ahead of 6.7.0 addressing packaging, React Server Components (RSC), build, and CI issues found across unreleased changes on
6.x.Packaging and build
native/node_modules/from the published npm tarball by replacing"native"inpackages/styled-components/package.jsonfileswith"native/dist"and"native/package.json".native/dist/dist/**/*.d.tsdeclaration tree by passing...basePluginsinstead of...commonPluginsinnativeConfig.plugins(dropping 68 duplicate.d.tsfiles from the tarball) and clearingnative/distinprebuild.configureServerStylesout ofsrc/base.tsintosrc/index.tsso the dead stub is omitted from standalone UMD bundles.RSC and runtime safety
nextStylisinStyleSheetManagerbefore updating the RSC stylis cache fields, and avoid clobbering the cache in theelse if (hasStylisOptions)path, so a throwing plugin or option setup cannot poison subsequent renders.inchecks inflatten.tsand dev-modeComponentStyle.ts, and tightenhasStyledComponentBrandto require a non-empty stringstyledComponentIdwhile keepingisStyledComponentcompatible with React Native's boolean brand.Docs, changesets, and CI
.changeset/global-style-function-id.md.docs/rsc-style-injection.mdandAGENTS.mdwith the current RSC style-injection andconfigureServerStylesbehavior.pnpm check:type-resolutionto.github/workflows/test.ymland remove the expired[email protected]block frompnpm-workspace.yaml.