[x-internals] Re-export tier-2 generic utilities from @base-ui/utils - #23374
Draft
romgrk wants to merge 2 commits into
Draft
[x-internals] Re-export tier-2 generic utilities from @base-ui/utils#23374romgrk wants to merge 2 commits into
romgrk wants to merge 2 commits into
Conversation
Consumes mui/base-ui#5542 (pinned to a pkg.pr.new preview) and converts the moved modules to re-exports: disposable, useDisposable, fastMemo, forwardRef, hash, isDeepEqual, isHTMLElement, isObjectEmpty, loadStyleSheets, lruMemoize, math, rafThrottle, slots, throttle, generic types, useEffectAfterFirstRender, useIsHydrated, useResizeObserver, useRunOnce. X-specific types (MuiEvent, GridChartsIntegration, SlotComponentPropsFromProps) stay. Tier-1 near-duplicates (getTarget, fastObjectShallowCompare, warning, formatErrorMessage, useFirstRender, platform, reactMajor) are handled separately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@base-ui/utils renamed useRunOnce to useLayoutEffectRunOnce. Alias it back so @mui/x-internals/useRunOnce keeps its current name, and bump the preview pin to pick up the review fixes from mui/base-ui#5542. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the x-internals →
@base-ui/utilsdeduplication (follows the store move). Consumes mui/base-ui#5542 and converts the moved modules into re-exports, deleting ~1,500 lines of duplicated implementation and tests (the tests moved to base-ui with the code).Draft until mui/base-ui#5542 is released — the catalog pins
@base-ui/utilsto a pkg.pr.new preview of that PR (@d1e1c9a); revert to a released version before merging (TODO comment inpnpm-workspace.yaml).Converted to re-exports
disposable,useDisposable,fastMemo,forwardRef,hash,isDeepEqual,domUtils/isHTMLElement,isObjectEmpty,export/loadStyleSheets,lruMemoize,math,rafThrottle,slots,throttle, generictypes,useEffectAfterFirstRender,useIsHydrated,useResizeObserver,useRunOnce.All public entry points (
@mui/x-internals/*) and export names are unchanged. Upstream renameduseRunOncetouseLayoutEffectRunOnce, which is aliased back here so@mui/x-internals/useRunOncekeeps its name.Kept in x-internals
MuiEvent,GridChartsIntegration,SlotComponentPropsFromProps(depends on@mui/utils/types).getTarget,fastObjectShallowCompare,warning,formatErrorMessage,useFirstRender,platform,reactMajor) — handled in a separate effort.EventManager,ToolbarContext,useAssertModelConsistency,useComponentRenderer.Validation
pnpm test:jsdom packages/x-internals— 18 passed.pnpm test:jsdom packages/x-tree-view— 994 passed (exercisesuseDisposable).pnpm typescript— fails with 5 pre-existing errors unrelated to this PR (see below).Known blocker: store API tightening on base-ui master
pnpm typescriptreports 5 errors, all at@base-ui/utils/storecall sites and none in code this PR touches:x-scheduler-internals/.../SchedulerStore.ts:280anduse-event-calendar/EventCalendarStore.ts:193—Partial<State>not assignable toPick<State, Key>x-scheduler-internals-premium/.../dataSource.test.ts:924,942,960—store.set(...)not callableCause: the
StoreAPI tightened on base-ui master in mui/base-ui#5423, which any master preview carries.updateset@base-ui/utils@0.3.1update(changes: Partial<State>)set<T>(key: keyof State, value: T)update<const Key extends keyof State>(changes: Pick<State, Key>)set<Key extends keyof State>(key: Key, value: State[Key])Adapting those call sites belongs with the store migration work, not with this utils move, so they are left untouched here. This PR cannot go green until that lands.
🤖 Generated with Claude Code