js-sdk-contrib
js-sdk-contrib copied to clipboard
feat(web-global-build): concept + impl?
This PR
- Adds a global (IIFE) build for the web for GrowthBook and LaunchDarkly
Notes
It's a concept only, I'm not quite sure if OpenFeature Community is likely to follow this idea. If so, I'll update this PR by improving a build process since this repository has a special build system.
How to test
- Run npm run build and ensure dist/global/index.js is generated for GrowthBook and LaunchDarkly web client
Motivation
Trying to load OpenFeature as a first dependency before browser will resolve any modules.
Hey @zduneckim, I will have a look at this tomorrow :) Please also sign-off the commit for this, as with the other PR.
@lukas-reining
What you think about this? As I said before, it's a concept only - let me know if idea is fine for you. If so, I'll try to fix test issues + find a better build solution and apply DRY.
Best,
Hey @zdunecki sorry for the delay! I think this is a good addition! We should consider adding it to the generators if everyone is in favor: https://github.com/open-feature/js-sdk-contrib/blob/main/tools/workspace-plugin/src/generators/open-feature/index.ts#L166 It seems like it might be be enough to declare any vendor SDK as external and otherwise have a generic esbuild config?
@lukas-reining No worries. Sounds cool, so if I'm back to contribution, I'll implement that.
Can't say when, but I'll try soon.
Best,