Skip to content

Conversation

@GarboMuffin
Copy link
Member

@GarboMuffin GarboMuffin commented Jan 10, 2026

Why:

  • We use immutable.js 3.8.2 which is ancient and not getting updates
  • immutable.js adds 55KB to the bundle, of which we use almost nothing
  • immutable.js's treatment of 0 and -0 is nonsensical and would require weird workarounds like Fix negative zero in monitors #320
  • We don't benefit from the whole immutability thing

What we're doing instead:

  • We have our own MonitorState and MonitorRecord classes
  • We track dirty-ness at modification time instead of equality checking every tick
  • scratch-gui and packager can continue to think we use immutable.js without causing issues in either direction
    • our objects have enough stubs that immutable.js-expecting consumers are ok
    • when receiving an object, we check if it looks like an immutable.js one and ask for the plain JS version so that works okay too

@GarboMuffin GarboMuffin merged commit 6abc33d into develop Jan 10, 2026
2 checks passed
@GarboMuffin GarboMuffin deleted the remove-immutable branch January 10, 2026 04:30
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.

2 participants