Simplify resizable API: use persist: false | 'localStorage' | fn#7395
Conversation
|
- Replace `NoPersistConfig` and `CustomPersistConfig` with single `PersistConfig` type - Change `persist` to accept `false | 'localStorage' | function` - Update `saveWidth` function to handle new API - Update type guards and exports - Update all tests to use new API - Update stories to use `persist:` instead of `save:` Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
28e77e6
into
make-primer-react-pagelayout-accept-persister
Consolidates
resizableprop configuration from separate{persist: false}and{save: fn}patterns into unified{persist: false | 'localStorage' | fn}API.Changelog
Changed
resizableprop now accepts{persist: false | 'localStorage' | fn}instead of separate{persist: false}and{save: fn}configsCustomPersistConfig→PersistConfigNoPersistConfig→ removed (merged intoPersistConfig)persistproperty instead ofsaveBefore:
After:
New
PersistFunctiontype for custom persistenceisCustomPersistFunctiontype guardisPersistConfigtype guardRemoved
NoPersistConfigtype (merged intoPersistConfig)CustomPersistConfigtype (replaced byPersistConfig)isNoPersistConfigtype guardisCustomPersistConfigtype guardRollout strategy
Note: While this changes the API surface, the original PR hasn't been released yet, so this is effectively a pre-release refinement.
Testing & Reviewing
Merge checklist
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.