tldraw/apps
alex 93c2ed615c
[Snapping 1/5] Validation & strict types for fractional indexes (#2827)
Currently, we type our fractional index keys as `string` and don't have
any validation for them. I'm touching some of this code for my work on
line handles and wanted to change that:
- fractional indexes are now `IndexKey`s, not `string`s. `IndexKey`s
have a brand property so can't be used interchangeably with strings
(like our IDs)
- There's a new `T.indexKey` validator which we can use in our
validations to make sure we don't end up with nonsense keys.

This PR is part of a series - please don't merge it until the things
before it have landed!
1. #2827 (you are here)
2. #2831
3. #2793
4. #2841
5. #2845

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. Mostly relying on unit & end to end tests here - no user facing
changes.

- [x] Unit Tests
2024-02-14 17:53:30 +00:00
..
docs docs: tweak search kbd placement to match loupe (#2834) 2024-02-14 10:37:03 +00:00
dotcom dev: swap yarn test and test-dev for better dx (#2773) 2024-02-14 16:05:59 +00:00
dotcom-asset-upload dev: swap yarn test and test-dev for better dx (#2773) 2024-02-14 16:05:59 +00:00
dotcom-bookmark-extractor Bump Yarn to 4.0.2 and add version constraints (#2481) 2024-01-18 11:09:17 +00:00
dotcom-worker dev: swap yarn test and test-dev for better dx (#2773) 2024-02-14 16:05:59 +00:00
examples [Snapping 1/5] Validation & strict types for fractional indexes (#2827) 2024-02-14 17:53:30 +00:00
health-worker Update the project to Node 20 (#2691) 2024-01-31 16:53:40 +00:00
huppy repair Huppy's handling of LICENCE (#2821) 2024-02-13 15:09:59 +00:00
vscode VS Code 2.0.24 (#2816) 2024-02-13 12:26:11 +00:00