-
Notifications
You must be signed in to change notification settings - Fork 3
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
only include isomorphic-fetch if the application has explicitly disabled native fetch #838
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,7 +6,13 @@ | |||||||||
* @typedef {import("./typings/metrics").TickingMetric} TickingMetric | ||||||||||
*/ | ||||||||||
|
||||||||||
require('isomorphic-fetch'); | ||||||||||
// only include isomorphic-fetch if the application has explicitly disabled native fetch | ||||||||||
if ( | ||||||||||
process.allowedNodeEnvironmentFlags.has('--no-experimental-fetch') && | ||||||||||
process.execArgv.includes('--no-experimental-fetch') | ||||||||||
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: not that we support said versions anymore, but
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh very good point |
||||||||||
) { | ||||||||||
require('isomorphic-fetch'); | ||||||||||
} | ||||||||||
|
||||||||||
const fs = require('fs'); | ||||||||||
const path = require('path'); | ||||||||||
|
@@ -68,7 +74,8 @@ const getAppContainer = (options) => { | |||||||||
if (options.withAb) { | ||||||||||
logger.warn({ | ||||||||||
event: 'WITHAB_OPTION_DEPRECATED', | ||||||||||
message: 'The \'withAb\' option is deprecated and no longer supported by n-express or n-flags-client' | ||||||||||
message: | ||||||||||
"The 'withAb' option is deprecated and no longer supported by n-express or n-flags-client" | ||||||||||
Comment on lines
+77
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like prettier or something edited an unrelated bit of code. The config seems wrong because ESLint is complaining about double quotes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bike shedding territory:
|
||||||||||
}); | ||||||||||
} | ||||||||||
|
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: could we expand this comment to add a bit of context on why we're doing this? afaict it's to satisfy problem hub as there won't be any behavioural change (as
isomorphic-fetch
already checks if native fetch is present)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this idea is from Jen's original native fetch investigation. which i should have read a bit closer, because the reason she's suggesting doing it this way is so we can add a warning here.
i'll do that.maybe?