## Description
1. What is this PR about (link the issue and add a short description)
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
Another layer in sync engine is composable storage.
Now you can specify a chain of storages. Each can listen transactions to
update some state. Though subscription for state is invoked one by one
until non-undefined is provided.
See tests to understand API.
Here I also migrated our server data loading and synchronization to this
storage api.
Load only arrays instead of maps from server
and convert data to map on client.
This reduces download size and server cpu usage.
340 kB -> 269 kB
218 kB -> 170 kB
22%
Ref https://github.com/webstudio-is/webstudio/issues/2647
Here refactored overflow UI to update "overflow-x" and "overflow-y"
longhands instead of "overflow" shorthand.
Removed "overflow" from advanced panel suggestions.
Added support for expanding overflow shorthand for webflow copy paste.
And implemented very basic migrations utility
which always run after data is loaded from server
and sends patch for expanding overflow longhands.
Patch is not sent when no properties are modified. Though eventually we
will need to support versioning to avoid executing old migrations.
<img width="279" alt="Screenshot 2024-06-18 at 19 33 21"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ce44385e-3316-4e34-bc9c-5f790cbdcd4f">
To synchronize data between tabs it should be consistent and be easily
accessible. Loading from server creates huge latency and data can be
changed by loading from another tab.
Here moved data loading to client side so it can be shared through
IndexedDB.
Added new `/rest/data/:buildId` endpoint and defined global setter and
getter for current state.