Releases: open-pioneer/trails-core-packages
@open-pioneer/[email protected]
Patch Changes
- 11b1428: Export
rethrowAbortError
from core package and use it correctly inHttpService
.
@open-pioneer/[email protected]
Minor Changes
- a18d227: New helper function
rethrowAbortError
.
@open-pioneer/[email protected]
Patch Changes
- f5c0e31: Bump @formatjs/intl version
- f5c0e31: Bump @testing-library/* dependencies
- Updated dependencies [f5c0e31]
- @open-pioneer/[email protected]
- @open-pioneer/[email protected]
@open-pioneer/[email protected]
Major Changes
-
ce9e060: Remove support for closed shadow roots.
Shadow roots used by trails applications are now always"open"
.
See #19. -
6f954e3: Breaking Change: change how services integrate into TypeScript (fixes #22).
The old TypeScript integration had unexpected edge cases, see the linked issue.NOTE: The changes below have no impact on runtime behavior, but they may trigger TypeScript errors in your code.
-
To register a service's type with TypeScript, one previously used a block such as this:
// OLD! Can be removed import "@open-pioneer/runtime"; declare module "@open-pioneer/runtime" { interface ServiceRegistry { "http.HttpService": HttpService; } }
The new method requires the developer to change the service's declaration.
Simply addextends DeclaredService<"SERVICE_ID">
to your service interface, whereSERVICE_ID
should match the service's interface name ("provides"
inbuild.config.mjs
).+ import { DeclaredService } from "@open-pioneer/runtime"; - export interface HttpService { + export interface HttpService extends DeclaredService<"http.HttpService"> { - import "@open-pioneer/runtime"; - declare module "@open-pioneer/runtime" { - interface ServiceRegistry { - "http.HttpService": HttpService; - } - }
-
To use a service from React code (i.e.
useService
anduseServices
), you must now use the explicit service type in the hook's generic parameter list. Otherwise the hook will simply returnunknown
:+ import { HttpService } from "@open-pioneer/http"; - const httpService = useService("http.HttpService"); + const httpService = useService<HttpService>("http.HttpService");
This change was necessary to fix an issue where the global registration of the service interface (and its association with the string constant) was not available.
The system will still check that the provided string matches the string constant used in the service's declaration (
DeclaredService<...>
), so type safety is preserved. -
The types
InterfaceName
andServiceType<I>
have been removed. Use explicit service interfaces instead. -
The interfaces
ServiceRegistry
andPropertiesRegistry
have been removed as global registration is no longer possible. -
The type
RawApplicationProperties
has been removed. UseApplicationProperties
instead.
-
Patch Changes
- f5c0e31: Bump @formatjs/intl version
- Updated dependencies [f5c0e31]
- Updated dependencies [6f954e3]
- @open-pioneer/[email protected]
- @open-pioneer/[email protected]
- @open-pioneer/[email protected]
@open-pioneer/[email protected]
Major Changes
- 6f954e3: Compatibility with @open-pioneer/runtime@^2
Patch Changes
- Updated dependencies [f5c0e31]
- Updated dependencies [ce9e060]
- Updated dependencies [6f954e3]
- @open-pioneer/[email protected]
@open-pioneer/[email protected]
Major Changes
- 6f954e3: Compatibility with @open-pioneer/runtime@^2
Patch Changes
- Updated dependencies [f5c0e31]
- Updated dependencies [ce9e060]
- Updated dependencies [6f954e3]
- @open-pioneer/[email protected]
@open-pioneer/[email protected]
Patch Changes
- f5c0e31: Bump chakra-related dependency versions
@open-pioneer/[email protected]
Minor Changes
- 6f954e3: Compatibility with @open-pioneer/runtime@^2
Patch Changes
- Updated dependencies [f5c0e31]
- @open-pioneer/[email protected]
@open-pioneer/[email protected]
Patch Changes
- Updated dependencies [6632892]
- @open-pioneer/[email protected]
- @open-pioneer/[email protected]
@open-pioneer/[email protected]
Minor Changes
- 6632892: Implement support for custom chakra themes via the
theme
parameter increateCustomElement()
.
theme
from@open-pioneer/base-theme
is used as default when no other theme is configured.
Patch Changes
- Updated dependencies [6632892]
- Updated dependencies [6632892]
- @open-pioneer/[email protected]
- @open-pioneer/[email protected]
- @open-pioneer/[email protected]