-
Notifications
You must be signed in to change notification settings - Fork 36
Publish shared components #616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@thomaspoignant @lukas-reining you guys have any concerns with this? |
Well, sounds like a good idea to me. |
Currently, we bundle and publish the contents of "shared" already, as part of the web/server modules - if they are exported, they are already exposed publicly through those modules. I can't think of anything that fits into this category though, besides maybe the |
I like the idea a lot, and it can avoid mixing things in a provider. Using a shared component may help to avoid that. |
Yes, but currently we can decide what to export instead of completely exposing everything directly used by one of the SDKs.
Ya, thats what I meant. I currently also see nothing in the package that could lead to a problem if someone depends on it. So I think this change really helps and the potential issue is negligible. |
I was thinking about this more, and it's a good thing to be aware of. I think that we could actually have 2 exports from the package, one at the root, and one at I think it is a good idea to hide as much that isn't API surface as possible... so we should consider this if we add things in that category (agree there isn't much like this right now). |
This PR addresses: #616 by: - configuring CI to release a new module (in addition to server/web/react we now release the "core" module (previously called "shared"). - adding a peer dep to the above module to server/web/react - adding a workflow to ensure that `shared` is released ahead of associated web/server/react changes, and which also auto-increments the peer dep version when the core module is released - unrelated `typedoc` improvements/updates > [!NOTE] > I intend to create a new PR that will rename the dir structure according to the packages... so `shared/` will become `core/` and `client/` will become `web/`. I just didn't want to add confusion and noise to this PR. --------- Signed-off-by: Todd Baert <[email protected]>
This is done, and working. We now also have validation that makes sure |
Optimization to `@openfeature/core` package. Both server and web need the node-js `Events` interfaces, but obviously only the web needs them poly-filled (they come with node). This PR: - marks `events.js` as an external dep in `@openfeature/core` meaning it won't be bundled there (see esbuild [doc](https://esbuild.github.io/api/#external)) This means that now `@openfeature/core` no longer includes `events.js` (an un-needed polyfill for the server). The bundling pictured below only happens in the `dist/` of `@openfeature/web-sdk`, and no longer in `@openfeature/core` :  I've tested both the server and web SDKs based on this change locally in the js-contribs by running the e2e test suite. Relates to: #616 Signed-off-by: Todd Baert <[email protected]>
Currently we do not publish a "shared" module for common type/interfaces/classes between the web and server SDKs. This hasn't been too much of an issue so far, particularly since providers don't share exactly the same interface between both SDKs. However, recently, there's been a demonstrable need for a common artifact, for example, the flagd-in-process lib here. This artifact could be useful in both web/server contexts. There's probably more use-cases as well (maybe even some hooks?).
Now that we know there's a use case, we should:
The text was updated successfully, but these errors were encountered: