v7.2.0 (Minor Release)
Status: Released
This is a new minor release of the @alextheman/components package. It introduces new features and other backwards-compatible changes that should require little to no refactoring. Please read the description of changes below.
Description of Changes
- Deprecate the
Contextusage on the following:createBaseQueryBoundarycreateItemQueryBoundarycreateListQueryBoundarycreateTabGroup
- The reason for this is that it fixes an issue where composing multiple instances of the same group could result in components accidentally reading values from the wrong context.
- For example, if
QueryBoundaryBlogsandQueryBoundaryUserswere created separately, nesting one boundary inside another could cause components to resolve data from the nearest React context rather than the boundary they were originally created from. - As such, we now explicitly pass through the shared values to each individual component in the group, therefore allowing them to be used independently of React context.
- It also means that instead of the logic of each component needing access to everything in the context, it now only takes what it needs.
Migration Notes
- Existing code will continue to work without modification.
QueryBoundary.ContextandTab.Contextare now deprecated and no longer perform any action.- You may safely remove these wrappers or replace them with a React fragment (<>...</>).
Additional Notes
- I was tempted to make this a major release because it technically could've been a breaking change.
- However, I decided to just instead make the outer contexts do nothing, so that people who were using the contexts previously don't notice any major behavioural change, while we can still allow for this fix.
- Really this is a bug fix because it fixes a bug that occurs when you try and compose groups together. As such, I did want to release this as soon as possible but I knew it would be slightly risky as it does also mean a behavioural change.
- In any case, the bug should be fixed with this update, so now group composition should work just fine.