This repository was archived by the owner on Nov 18, 2025. It is now read-only.
fix: require fast-text-encoding only in browser#951
Merged
alexander-fenster merged 2 commits intomasterfrom Feb 1, 2021
Merged
fix: require fast-text-encoding only in browser#951alexander-fenster merged 2 commits intomasterfrom
alexander-fenster merged 2 commits intomasterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master googleapis/gax-nodejs#951 +/- ##
==========================================
+ Coverage 88.52% 88.67% +0.15%
==========================================
Files 43 43
Lines 7014 7030 +16
Branches 601 607 +6
==========================================
+ Hits 6209 6234 +25
+ Misses 795 786 -9
Partials 10 10
Continue to review full report at Codecov.
|
bcoe
approved these changes
Feb 1, 2021
bcoe
left a comment
There was a problem hiding this comment.
Is there an easy way to add a test for this?
| if ( | ||
| isBrowser() && | ||
| // eslint-disable-next-line node/no-unsupported-features/node-builtins | ||
| (typeof TextEncoder === 'undefined' || typeof TextDecoder === 'undefined') |
There was a problem hiding this comment.
Perhaps add a TODO comment here, reminding us to remove this check once we drop Node 10.
Contributor
Author
There was a problem hiding this comment.
Added TODO for myself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes googleapis/google-cloud-node-core#380 by requiring the
TextEncoder/TextDecoderpolyfill only in browser context. Since they exist in global scope in Node.js 11+, we also need to use the polyfill in Node 10 but this is temporary until Node 10 is EOL.