v6.0.0 #2180
Unanswered
coolsoftwaretyler
asked this question in
General
v6.0.0
#2180
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Breaking Changes
NonEmptyObject
by @thegedge in EliminateNonEmptyObject
#2152Features
hasEnv
, to support Feat/has env and getenv changes #2163Fixes
fail
as a required import in library code #2138 linter issues with fail function by @JuanJo4 in fix: #2138 linter issues with fail function #2171Tests
Docs
Docs: add recipe for mst-form-type by @sherlockwang in mst-form-type documentation in markdown as we talked in email #2168
Community/Developer Changes
New Contributors
Full Changelog: v5.4.2...v6.0.0
Migration Guide from v5 to v6
TypeScript update
Make sure you're using TypeScript
5.3.3
, and you have the following compiler flags:Or the shorthand:
Removing
$nonEmptyObject
We removed the
$nonEmptyObject
key from theModelCreationType
. For the most part, this was an internal feature that would only have shown up in TypeScript errors. There is no runtime change, but if you have any custom typings that relied on something like[$nonEmptyObject]
- you should be able to eliminate those.Union Type Changes
In the past, named enumerations had more specific type than unnamed enumerations. You may have some TypeScript errors where you were using anonymous enumerations. You can type those with the union of literal values inside the enumeration now.
This has also fixed #1525 and #1664
For #1525, If you had models with properties that were unions including other models, you may have done some type assertions to resolve the issue. This should no longer be necessary. In most cases, we don't expect this to show up as errors. But the inferred types have changed. Look through your codebase for unions of models in the properties of other models, and if you hit any issues, you may be able to use better typing form here on out.
The issue presented itself in #1664 when using types with different creation and instance types which were passed to unions inside of arrays. If you see more TypeScript errors aside from the other items mentioned, look for
types.union
that creates a union which includesArray
,Map
, orModel
types. If you had any custom type assertions, you may no longer need those.Array operation patch changes
When an
Array
type callsclear
, or splices itself from index0
, the generated patch is different. We have shortened the operations to be a patch like:If you use
onPatch
and expect any specific shape of patches fromArray.clear
orArray.splice
, you may need to update your app logic to handle the changed patch generation.getEnv now throws
If you call
getEnv
and there is no environment, it will now throw an error. Previously, it would return an empty object.Check your codebase for
getEnv
calls, and guard against this error withhasEnv
, which will returntrue
if the current state tree has an environment, orfalse
if not.This discussion was created from the release v6.0.0.
Beta Was this translation helpful? Give feedback.
All reactions