Skip to content

fix: revert 2218 to fix ts excessively deep types - #2234

Merged
coolsoftwaretyler merged 2 commits into
masterfrom
fix/revert-2218
Dec 18, 2024
Merged

coolsoftwaretyler merged 2 commits into
masterfrom
fix/revert-2218

Conversation

@coolsoftwaretyler

Copy link
Copy Markdown
Collaborator

What does this PR do and why?

This PR closes #2230, by reverting #2218. That means we'll have to repoen #2216, unfortunately.

In the long term, we'll want to fix these types at the root of the repository. But since we don't have a full roadmap for that, we are going to make a practical choice to prioritize fixing #2230 over fixing #2216.

For anyone who prefers the older fix, you can either patch the package yourself, or run from v7.0.0, which will still be available and have #2218 available in its source code.

Steps to validate locally

Tests should pass, old behavior should be restored. I have modified __tests__/core/2230.test.ts to include all of the reproducing code from #2230.

@thegedge thegedge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚀

@coolsoftwaretyler
coolsoftwaretyler merged commit f8bb147 into master Dec 18, 2024
@coolsoftwaretyler
coolsoftwaretyler deleted the fix/revert-2218 branch December 18, 2024 15:24
coolsoftwaretyler added a commit to coolsoftwaretyler/mobx-state-tree that referenced this pull request Oct 2, 2026
All six reproduce; each file compiles today and typecheck fails when
the defect is fixed, via @ts-expect-error BUG markers.

- mobxjs#1403, mobxjs#2216, mobxjs#2253: props and compose use plain intersections, so an
  optional override of a required prop stays required or becomes never.
  Re-landing an Omit-based override reopens the mobxjs#2230 depth trade-off
  (mobxjs#2218 reverted by mobxjs#2234); compose overloads need the same change.
- mobxjs#1463: create() accepts any object because ExcludeReadonly (from
  mobxjs#2199) is an indexed access over WritableKeys; the fix only tightens.
- mobxjs#1157: one directive is the reported inference limit on an
  unannotated circular view; ten others are the same mobxjs#2199 regression
  and flip when WritableKeys stops being evaluated eagerly.
- mobxjs#1367: .props after preProcessSnapshot never adds new props to the
  declared snapshot type.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

v7.0.0. type instantiation is excessively deep and possibly infinite

2 participants