Skip to content
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

fix: bundlers wrongly resolving server/client modules #445

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Jun 2, 2023

Fixes an issue that can cause bundlers in repos with both the web-sdk and js-sdk to incorrectly resolve and bundle module components because both modules use the same global symbols for the API.

@toddbaert toddbaert requested a review from moredip June 2, 2023 15:08
@toddbaert toddbaert requested a review from a team as a code owner June 2, 2023 15:08
@toddbaert
Copy link
Member Author

toddbaert commented Jun 2, 2023

@moredip I'm confident enough that this is the root cause of your issue that I think we should just commit it. I've seen the same behavior myself, but it's very tough to reproduce consistently.

Regardless, there's no reason I can think of that these 2 symbols should be the same.

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #445 (286ae52) into main (7e469c4) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 286ae52 differs from pull request most recent head cfaf6c0. Consider uploading reports for the commit cfaf6c0 to get more accurate results

@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
- Coverage   99.47%   99.47%   -0.01%     
==========================================
  Files          25       25              
  Lines        2469     2468       -1     
  Branches      236      236              
==========================================
- Hits         2456     2455       -1     
  Misses         13       13              
Impacted Files Coverage Δ
packages/client/src/open-feature.ts 95.60% <100.00%> (ø)
packages/server/src/open-feature.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@toddbaert toddbaert requested a review from beeme1mr June 2, 2023 15:14
@toddbaert toddbaert changed the title fix: use a different symbol for server/client fix: issues with bundlers resolving server/client modules Jun 2, 2023
Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it make sense to use a different symbol for client and server. I'm just wondering if we should call it client and server instead of web-sdk and js-sdk. Client/server is what we went with on the main readme.

@toddbaert
Copy link
Member Author

I think it make sense to use a different symbol for client and server. I'm just wondering if we should call it client and server instead of web-sdk and js-sdk. Client/server is what we went with on the main readme.

I had the same thought but went with the actual artifact name because I thought that would make it very clear in debugging. Client is a bit overloaded.

@toddbaert toddbaert changed the title fix: issues with bundlers resolving server/client modules fix: bundlers wrongly resolving server/client modules Jun 2, 2023
@beeme1mr beeme1mr merged commit 6acddd5 into main Jun 6, 2023
beeme1mr pushed a commit that referenced this pull request Jun 6, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.3.3-experimental](web-sdk-v0.3.2-experimental...web-sdk-v0.3.3-experimental)
(2023-06-06)


### Features

* add init/shutdown and events
([#436](#436))
([5d55ea1](5d55ea1))
* add named client support
([#429](#429))
([310c6ac](310c6ac))
* add support for flag metadata
([#426](#426))
([029ec26](029ec26))


### Bug Fixes

* bundlers wrongly resolving server/client modules
([#445](#445))
([6acddd5](6acddd5))
* only shutdown providers that are not attached to any client
([#444](#444))
([7e469c4](7e469c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
beeme1mr added a commit that referenced this pull request Jun 6, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.3.0](js-sdk-v1.2.0...js-sdk-v1.3.0)
(2023-06-06)


### Features

* add init/shutdown and events
([#436](#436))
([5d55ea1](5d55ea1))
* add named client support
([#429](#429))
([310c6ac](310c6ac))
* add support for flag metadata
([#426](#426))
([029ec26](029ec26))


### Bug Fixes

* bundlers wrongly resolving server/client modules
([#445](#445))
([6acddd5](6acddd5))
* only shutdown providers that are not attached to any client
([#444](#444))
([7e469c4](7e469c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Beemer <[email protected]>
@beeme1mr beeme1mr deleted the fix/use-2-symbols branch February 5, 2025 21:24
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.

2 participants