BREAKING: allow to pass an outer yoga provider #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disclaimer: my original idea was to just replace
yoga-layout-prebuilt
withyoga-layout-wasm
(like #67 or #37 ), but my experements proved importing wasm files and usingyoga-layout-wasm
in general is not easy task and requires configuring userland bundler, hurting the UX. For instance, I experienced cryptic webpack errors in storybook, vite tried to prebuild the wasm file instead of importing it as a url and so on. So I decided that if we can provide a way to pass a outer yoga runtime while still having the ability to use vanillayoga-layout-prebuilt
experience -- that's the right wayThis is mainly to allow usage of yoga-layout-wasm. From now on there's 2 entrpoints,
a default one with YogaPrebuiltProvider (which uses yoga-layout-prebuilt)
and outerRuntime that exports YogaProvider that allows to pass an arbitrary runtime
(that conforms with Yoga types)
This is a breaking change because library users will have to place a YogaProvider/YogaPrebuiltProvider in their code
Fixes #66