Skip to content

Conversation

@gatteo
Copy link

@gatteo gatteo commented Jan 6, 2026

Remove the tight coupling to pear-wrk-wdk by accepting bundleConfig (containing bundle and HRPC) as explicit function parameters instead of importing from the package directly.

The worklet is now started only in the provider.

Key changes:

  • WorkletLifecycleService.startWorklet now accepts bundleConfig as 2nd param
  • WdkAppProvider passes bundleConfig directly to startWorklet
  • ensureWorkletStarted simplified to just validate worklet is started
  • Remove pear-wrk-wdk from dependencies
  • Update all tests to use local mocks instead of pear-wrk-wdk imports
  • Define HRPC types locally in src/types/hrpc.ts

This allows consumers to provide their own bundle and HRPC implementation, making the library more flexible and decoupled.

Remove the tight coupling to pear-wrk-wdk by accepting bundleConfig
(containing bundle and HRPC) as explicit function parameters instead
of importing from the package directly.

Key changes:
- WorkletLifecycleService.startWorklet now accepts bundleConfig as 2nd param
- WdkAppProvider passes bundleConfig directly to startWorklet
- ensureWorkletStarted simplified to just validate worklet is started
- Remove pear-wrk-wdk from dependencies
- Update all tests to use local mocks instead of pear-wrk-wdk imports
- Define HRPC types locally in src/types/hrpc.ts

This allows consumers to provide their own bundle and HRPC implementation,
making the library more flexible and decoupled.
- Add Bundle Configuration section explaining two options:
  - Option A: Generate custom bundle with wdk-worklet-bundler CLI
  - Option B: Use pre-built pear-wrk-wdk package
- Update all examples to include the required bundle prop
- Update WdkAppProvider API reference with full props interface
- Add TypeScript configuration guidance for generated bundles
Set SecureStorage in WalletSetupService synchronously during render
instead of in a useEffect. This prevents race conditions where child
components' useEffect hooks run before the parent's effect, causing
"SecureStorage not initialized" errors.
@gatteo gatteo force-pushed the refactor/remove-pear-wrk-wdk-dependency branch from f470ed1 to 7607a10 Compare January 15, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant