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

Switch to custom base64 implementation #346

Merged
merged 1 commit into from Jun 25, 2021

Conversation

IvanGoncharov
Copy link
Member

Previously we used Node's API for converting to/from base64
but it limits portability of this library to defirent enviroments
include Deno

Fixes #152

Previously we used Node's API for converting to/from base64
but it limits portability of this library to defirent enviroments
include Deno

Fixes graphql#152
@IvanGoncharov IvanGoncharov added the PR: breaking change 💥 implementation requires increase of "major" version number label Jun 25, 2021
@codecov
Copy link

codecov bot commented Jun 25, 2021

Codecov Report

Merging #346 (b290c74) into main (cde9d0e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #346   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          632       718   +86     
  Branches        37        48   +11     
=========================================
+ Hits           632       718   +86     
Impacted Files Coverage Δ
src/utils/__tests__/base64-test.js 100.00% <100.00%> (ø)
src/utils/base64.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cde9d0e...b290c74. Read the comment docs.

@IvanGoncharov IvanGoncharov merged commit 20b16ec into graphql:main Jun 25, 2021
@IvanGoncharov IvanGoncharov deleted the pr_branch branch June 25, 2021 16:22
@itajaja
Copy link

itajaja commented Jul 5, 2021

hi! how's this a breaking change? is it safe to upgrade, and if not, why?

@itajaja
Copy link

itajaja commented Jul 5, 2021

I tried to upgrade to 0.8.0 and my tests fail with some Invalid code point errors, which probably derive from this change. is it a bug? or should i take care of the breaking change on my side? in general I don't see how change implementation for b64 should be a breaking change. any reason as to not use an existing impl, eg https://www.npmjs.com/package/base-64 ?

@IvanGoncharov
Copy link
Member Author

@itajaja It shouldn't be any observable changes for valid IDs, meaning your client treats them as opaque strings.
However, I simplify our own base64 implementation and now it rejects a bunch of invalid codes.
Without additional details, it's hard to know what happened in your case and if this error is intentional.
Can you please open a separate issue with more details?

any reason as to not use an existing impl, eg npmjs.com/package/base-64 ?

Long term plan is to merge this lib into graphql-js which is a zero-dependency library so we can't depend on anything beyond core JS. It allows us to support a bunch of different environments, e.g. Deno.

@itajaja
Copy link

itajaja commented Jul 7, 2021

@IvanGoncharov thanks. maybe some of my test UUIDs are in that invalid category that now gets rejected. if I think they are valid, I'll open another task. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: breaking change 💥 implementation requires increase of "major" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toGlobalId/fromGlobalId not working inside React Native
2 participants