coder / backstage-plugins

Official Coder plugins for the Backstage platform
34 stars 2 forks source link

chore: add StateSnapshotManager class #119

Closed Parkreiner closed 5 months ago

Parkreiner commented 5 months ago

Part 1 of the ongoing API factory changes for #107 Decided to start breaking these up to make the PRs easier to digest, and start getting the ball rolling faster.

Changes made

Notes

Once the PR is done, I'll start tinkering with things like Proxy objects to start figuring out if there's a way to make the class less error-prone. My hope is that I can make it so that the manager exposes a "mutable snapshot proxy", and when you mutate a property on it, that will automatically run logic to determine if the snapshot has meaningfully changed, and also notify subscriptions

My thinking is that we get the API code working (even if it's less than ideal), get it verified with tests, and then use the tests to guide refactoring.