File tree Expand file tree Collapse file tree 3 files changed +11
-17
lines changed
packages/google-cloud-language Expand file tree Collapse file tree 3 files changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -99,14 +99,11 @@ export class LanguageServiceClient {
9999 // const showcaseClient = new showcaseClient({ projectId, customConfig });
100100 opts . clientConfig = opts . clientConfig || { } ;
101101
102- const isBrowser = typeof window !== 'undefined' ;
103- if ( isBrowser ) {
104- opts . fallback = true ;
105- }
106- // If we are in browser, we are already using fallback because of the
107- // "browser" field in package.json.
108- // But if we were explicitly requested to use fallback, let's do it now.
109- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
102+ // If we're running in browser, it's OK to omit `fallback` since
103+ // google-gax has `browser` field in its `package.json`.
104+ // For Electron (which does not respect `browser` field),
105+ // pass `{fallback: true}` to the LanguageServiceClient constructor.
106+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
110107
111108 // Create a `gaxGrpc` object, with any grpc-specific options
112109 // sent to the client.
Original file line number Diff line number Diff line change @@ -99,14 +99,11 @@ export class LanguageServiceClient {
9999 // const showcaseClient = new showcaseClient({ projectId, customConfig });
100100 opts . clientConfig = opts . clientConfig || { } ;
101101
102- const isBrowser = typeof window !== 'undefined' ;
103- if ( isBrowser ) {
104- opts . fallback = true ;
105- }
106- // If we are in browser, we are already using fallback because of the
107- // "browser" field in package.json.
108- // But if we were explicitly requested to use fallback, let's do it now.
109- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
102+ // If we're running in browser, it's OK to omit `fallback` since
103+ // google-gax has `browser` field in its `package.json`.
104+ // For Electron (which does not respect `browser` field),
105+ // pass `{fallback: true}` to the LanguageServiceClient constructor.
106+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
110107
111108 // Create a `gaxGrpc` object, with any grpc-specific options
112109 // sent to the client.
Original file line number Diff line number Diff line change 44 "git": {
55 "name": ".",
66 "remote": "https://github.com/googleapis/nodejs-language.git",
7- "sha": "df4d71c7a3c6a4b02fb48ee5cfed76f795a446ea "
7+ "sha": "3c67c269d13636e9e645e4fdca50d312202abcfd "
88 }
99 },
1010 {
You can’t perform that action at this time.
0 commit comments