Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 91b42ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
nextThe tombstone said popover={{boundaryElement}}, but PopoverProps.
boundaryElement is itself removed in v4 - the working replacements are
floatingBoundary/referenceBoundary. Also correct the _visual-editing
migration note: the moved components (Menu*, Popover) import from their
new entry points, not the root. Both spotted in review by @jordanl17.
Co-authored-by: Cody Olsen <[email protected]>
Dropping typesVersions means moduleResolution "node" (node10) cannot resolve the subpath entry points' types - the root entry still resolves via the kept top-level types field. Document that v4 needs node16, nodenext or bundler. Raised in review by @jordanl17. Co-authored-by: Cody Olsen <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 167 out of 169 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/ui/src/exports/autocomplete.ts:12
AutocompleteInputFoocusMsglooks like a public type name typo ("Foocus"). Since this new subpath entrypoint is a good chance to improve the API surface, consider exporting a correctly spelled alias (while keeping the existing name for compatibility).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 166 out of 168 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/ui/src/exports/autocomplete.ts:12
- The exported type name
AutocompleteInputFoocusMsgcontains a typo ("Foocus"). Since this file is the public@sanity/ui/autocompleteentry point, consider also exporting a correctly spelled alias (AutocompleteInputFocusMsg) to avoid spreading the typo in consumer code while keeping backwards compatibility.
.changeset/ui-4.md:5 - Typo in the changeset intro: "4.0." reads like an incomplete version. Consider using the full version string (e.g. 4.0.0) and keep punctuation outside the inline code span.
**`@sanity/ui` 4.0.** The full upgrade procedure is in the [migration guide](https://github.com/sanity-io/ui/blob/main/MIGRATION.md). TypeScript walks you through most of it: every removed or moved API stays in the types as a `@deprecated` tombstone whose message names its replacement.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 165 out of 167 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/ui/src/core/components/menu/menu.tsx:67
focusFirst,focusLast, andspaceare tombstoned inMenuProps, but they’re not destructured out ofprops. If a JS consumer (or TS viaany) still passes them, they’ll end up inrestPropsand get forwarded toStyledMenu/the DOM, which can trigger React unknown-prop warnings. Destructure and ignore these props so they never reach the DOM.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 165 out of 167 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/ui/src/exports/autocomplete.ts:12
- The exported message type
AutocompleteInputFoocusMsgappears to have a spelling mistake in its identifier (Foocus). Since v4 is a major, consider introducing a correctly spelledAutocompleteInputFocusMsgand keepingAutocompleteInputFoocusMsgas a deprecated alias to reduce long-term API friction.
packages/ui/tsdown.config.mts:29 ./styles.cssdev export always pointsdefaultat./dist/styles.css, butpackages/ui/distis not present in the repo checkout untilpnpm --filter @sanity/ui buildis run. That makesimport '@sanity/ui/styles.css'fail for workspace consumers during local dev/test runs that rely on devexports(e.g. Storybook/Next/Vite). Consider making the non-publishdefaultresolve to a TS stub (or a checked-in placeholder CSS file) so the side-effect import is always resolvable in-source.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 165 out of 167 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/ui/src/exports/autocomplete.ts:22
AutocompleteInputFoocusMsghas a spelling mistake in its public export name. Since this is a major release, consider also exporting a correctly spelled alias (AutocompleteInputFocusMsg) while keeping the existing name for compatibility.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 164 out of 166 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.changeset/ui-4.md:5
- Release note heading has a stray trailing dot and reads as an incomplete version ("4.0."). This should be a stable version string for the major release note.
**`@sanity/ui` 4.0.** The full upgrade procedure is in the [migration guide](https://github.com/sanity-io/ui/blob/main/MIGRATION.md). TypeScript walks you through most of it: every removed or moved API stays in the types as a `@deprecated` tombstone whose message names its replacement.
Summary
The
nextbranch is the integration branch for@sanity/ui4.0. Merging this PR lands 4.0 onmain; the Version Packages PR that follows publishes the stable@sanity/[email protected].Prerelease mode has been exited, the Changesets
baseBranchand the CI/release workflow triggers are restored tomain-only, and the pending changesets are combined into a single 4.0 release note for@sanity/ui. The 4.x line was validated end-to-end as4.0.0-next.*prereleases published from this branch under thenextnpm dist-tag.@sanity/themeris excluded from this PR. Its published package stays exactly asmainships it (0.3.1): no changeset, no version bump, no peer/engines changes, and it is on the Changesetsignorelist so the@sanity/uimajor cannot auto-bump and republish it as a dependent. Only in-repo dev shims remain (subpath imports of the workspace@sanity/uiand a vanilla-extract vitest plugin), which the monorepo needs to build and test themer against the ui v4 source. A follow-up PR updates and releases themer against ui 4 and removes theignoreentry.The
3.xline lives on: a copy ofmainis on thev3branch, and #2551 sets up its maintenance config (release-v3dist-tag, workflows and Changesets onv3, docs) — same pattern asv2/release-v2.Validated by downstream consumers
The new major has been evaluated against the main consumers of
@sanity/ui:Migration guide & docs
MIGRATION.md(repo root) walks through the 3 → 4 upgrade as an ordered checklist, and points people staying on3.xat thev3branch /release-v3dist-tag; the docs navbar links to it ("Migrate to v4"). The combined 4.0 release note links to it as well.CONTRIBUTING.mdandAGENTS.mddescribe the maintenance-branch layout (v3/release-v3,v2/release-v2) from themainside, mirroring how #2551 documents it from thev3side.apps/docs) now renders from the v4 nav document (primaryNavId: 'v4'). Content fixes to the v4 nav happen in the Studio.mainnav in Oct 2025) is archived; a fresh empty "UI 4" release is active for staging v4 content updates.Breaking changes
1. ESM-only, Node.js
>=22.12(#2510)@sanity/uino longer ships a CommonJS build. Therequireexport condition and the.cjs/.d.ctsoutputs are gone, along with the legacymain/module/typesVersionsfields. This is not a code change for consumers: modern Node.js supportsrequire(esm), sorequire('@sanity/ui')keeps working on supported Node versions — things only break if the Node version is too old. Theenginesrange on@sanity/uiis raised to>=22.12to matchsanity.2. React 19.2+ required (#2507)
Peer ranges tighten from
^18 || >=19.0.0-0to^19.2for bothreactandreact-dom. The 19.2 floor is set by the new<Activity>component, which shipped in React 19.2.0 and which v4 uses forTooltip/Popovermounting. The React Compiler now targets'19'and uses React's built-in runtime, so thereact-compiler-runtimedependency is dropped.3. Subpath entry points for heavy components (#2522)
Importing
@sanity/uino longer pulls in@floating-ui/react-dom,motionorreact-refractor, regardless of bundler treeshaking. Components that need them moved to their own entry points, along with their prop, context and message types (PopoverProps,ToastParams,MenuItemProps,AutocompleteState,TooltipDelayGroupContextValue, …):@sanity/ui/toastToast,ToastProvider,useToast@sanity/ui/popoverPopover@sanity/ui/tooltipTooltip,TooltipDelayGroupProvider,useTooltipDelayGroup@sanity/ui/menuMenu,MenuButton,MenuDivider,MenuGroup,MenuItem@sanity/ui/autocompleteAutocomplete@sanity/ui/breadcrumbsBreadcrumbs@sanity/ui/codeCodeThe root entry keeps
@deprecatednever-typed tombstones for every moved symbol, so TypeScript points at the new location instead of erroring with "does not exist".ErrorBoundaryrenders a plain<pre><code>so the root entry stays free of thereact-refractormodule graph.4. Static CSS moved to
@sanity/ui/styles.css(#2523)Styles that don't depend on the theme or props are extracted into a static stylesheet at build time instead of injected at runtime — in this release that covers
SrOnly,Spinnerand internal text-overflow styling. These components have moved off styled-components; more follow in future 4.x minors, and UI5 ships without styled-components or any other runtime CSS-in-JS. The stylesheet is not loaded automatically — add the import once, next to where the app renders<ThemeProvider>:The stylesheet ships unminified for diffability (#2528) with a TypeScript declaration (#2536).
5. Deprecated props, hooks and components tombstoned (#2509, #2514)
Removed props stay on the public types as
never, so TypeScript surfaces the migration message. Deprecated hooks andConditionalWrapperkeep callable exports that throw at runtime.spacegapcolumns/rows/column*/row*gridTemplateColumns/gridTemplateRows/gridColumn*/gridRow*focusFirst/focusLastshouldFocuspopover={{…}}boundaryElementfloatingBoundary/referenceBoundary(plusBoundaryElementProviderfor max-width /constrainSize)allowedAutoPlacementsfallbackPlacementsuseClickOutsideuseClickOutsideEventuseElementRectuseElementSizeuseForwardedRefuseRef+useImperativeHandleuseArrayProp(value)Array.isArray(value) ? value : [value]6. Private
_visual-editingentry point removed (#2513)@sanity/ui/_visual-editingis gone — import from@sanity/uiinstead. The slim subset is unnecessary now thatdisplayNameside effects are gone and unused components drop out of consuming bundles.7. Native
ResizeObserver(#2518)The
@juggle/resize-observerpolyfill dependency and the internal_ResizeObserverexport are dropped. Use the globalResizeObserver.Behavioural changes worth calling out
<Activity>-based mounting (#2508) —TooltipandPopoverkeep content mounted with React's<Activity>when closed, preserving internal state and pre-rendering hidden content; withanimatethey useAnimateActivityto defer hiding until exit animations finish. Popovers with recursive content must gate the recursion onopen, otherwise they render an infinitely deep hidden tree. Note for test suites: closed tooltips/popovers now exist in the DOM as hidden content, so e2e assertions must check visibility, not DOM presence.forwardRef(#2519) — all components are plain function components takingrefas a regular prop. Refs behave the same, but components no longer passreact-ischecks such asisForwardRef.@sanity/themerNot part of this release. The published package stays at
main's0.3.1and is on the Changesetsignorelist, so the ui major cannot auto-bump it. A follow-up PR adopts ui 4 in themer (peer ranges, engines, compiler target), releases it, and cleans up the abandoned1.0.0-next.*prereleases on thenextdist-tag.Done:
pre.json(verified by dry run:changeset versionproduces@sanity/[email protected])main-oriented release config (ChangesetsbaseBranch: "main", CI/release workflows trigger onmainonly)@sanity/ui(it links toMIGRATION.md)@sanity/themerexcluded from the release (no changeset, publish contract identical tomain, Changesetsignore; verified by dry run that a version run leaves it untouched)MIGRATION.md, linked from the docs navbar)v3maintenance branch created frommain—v3exists, and this branch's docs point at itRemaining before merging:
v3releases (release-v3dist-tag, workflows and ChangesetsbaseBranchonv3, maintenance-branch docs) so 3.x hotfixes never touchlatestAfter merging, the Version Packages PR on
mainwill contain the stable@sanity/[email protected]— merging it publishes to npm under thelatestdist-tag.