Skip to content

3.0.0

Choose a tag to compare

@binjospookie binjospookie released this 05 Nov 10:32
· 37 commits to main since this release
5ceb7ea

Changed

  • BREAKING: component field renamed to Component (capital C) to enable React hooks usage in inline components without ESLint warnings

  • BREAKING: API structure changed to target-first approach

    Before (v2):

    slotsApi.insert.into.Description({ component: MyComponent });

    After (v3):

    slotsApi.Description.insert({ Component: MyComponent });

    Benefits:

    • Discoverability: Type slotsApi. to see all available slots, then slotsApi.[SlotName]. to see all actions for that slot
    • Logical grouping: All methods for a specific slot are in one place

Added

  • clear method to clear all components from a slot

Migration from v2 to v3

  1. Replace slotsApi.insert.into.[SlotName] with slotsApi.[SlotName].insert
  2. Replace component: with Component: in all insert calls

Example:

// v2
slotsApi.insert.into.Header({ component: MyComponent });

// v3
slotsApi.Header.insert({ Component: MyComponent });