tldraw/packages
Mitja Bezenšek 9915f2b0f6
Fix migrations. (#2302)
Fix `instance_page_state` migrations. We discovered this in a file that
a user sent.

I updated the existing migration since it caused data loss. It looks
like we had a few migrations dealing with `croppingShapeId`:
- First we added the prop with the name `croppingShapeId` and value of
`null` (`AddCroppingId` migration)
- We then have a dummy migration, which doesn't change anything
(`RenameProperties` migration)
- We then override the existing value of `croppingShapeId` with an
non-existent property `croppingId`. This clears out the value and leads
to data loss. (`RenamePropertiesAgain` migration).

So we now avoid that by first looking at `croppingShapeId`, but we still
keep the `croppingId` as a fallback. Felt safer this way.


### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version


### Release Notes

- Fix migrations of `instance_page_state`.
2023-12-07 13:23:22 +00:00
..
assets Update CHANGELOG.md [skip ci] 2023-11-10 10:49:37 +00:00
editor Add fit to content for frames. (#2275) 2023-12-07 12:57:56 +00:00
state Replace getters in examples (#2261) 2023-11-28 17:33:10 +00:00
store No impure getters pt10 (#2235) 2023-11-16 12:07:33 +00:00
tldraw Add fit to content for frames. (#2275) 2023-12-07 12:57:56 +00:00
tlschema Fix migrations. (#2302) 2023-12-07 13:23:22 +00:00
utils fix vite HMR issue (#2279) 2023-12-01 16:48:30 +00:00
validate Update CHANGELOG.md [skip ci] 2023-11-10 10:49:37 +00:00