mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 14:00:37 +00:00
`pcb/update-component` attached the whole `:objects` map of a deleted component to every `mod-component` change, so a single component swap re-sent thousands of shapes that the same batch already carried as shape changes. In one measured swap the 49 maps with objects were 94% of the request (6.3 MB), and only 27% of the 4.275 shapes they carried differed from what the server had. Now `mod-component` carries component metadata only, and shapes inside a component travel as `:mod-obj` changes scoped with `:component-id`, which is what the component sync already emits. An absent `:objects` key means "leave the stored shapes alone", only an explicit `nil` drops them, so metadata-only changes cannot wipe a deleted component. The two repairs that fix shapes inside a component (shape-ref cycle and duplicated swap slot) now emit one `:mod-obj` per shape; the two that move or clear the `:objects` key keep the whole-map write behind the new `:objects? true` option. Same swap on the measured file: 6.328.307 to 382.571 bytes. AI-assisted-by: space-bunny