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

Migrate node v window logic #418

Merged
merged 2 commits into from
Nov 12, 2020
Merged

Migrate node v window logic #418

merged 2 commits into from
Nov 12, 2020

Conversation

rogebrd
Copy link
Contributor

@rogebrd rogebrd commented Nov 9, 2020

Migrate logic from trying with require to checking for existence of window

Checklist

General Contributing

  • Have you read the Code of Conduct and signed the CLA?

Is This a Code Change?

  • Non-code related change (markdown/git settings etc)
  • SDK Code Change
  • Example/Test Code Change

Validation

  • Does npm test pass?
  • Does npm run build pass?
  • Does npm run lint pass?

Migrate logic from trying with require to checking for existence of window
@codecov
Copy link

codecov bot commented Nov 9, 2020

Codecov Report

Merging #418 (90d37b9) into main (2df7046) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #418   +/-   ##
=======================================
  Coverage   52.19%   52.19%           
=======================================
  Files           7        7           
  Lines         730      730           
=======================================
  Hits          381      381           
  Misses        349      349           
Flag Coverage Δ
integration 46.71% <100.00%> (ø)
unit 47.26% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/auth.js 36.80% <100.00%> (ø)
src/dropbox.js 75.40% <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 2df7046...90d37b9. Read the comment docs.

@rogebrd rogebrd requested a review from aelawson November 9, 2020 20:40
Copy link
Contributor

@aelawson aelawson left a comment

Choose a reason for hiding this comment

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

This seems fine, left one comment.

try {
fetch = require('node-fetch'); // eslint-disable-line global-require
} catch (Exception) {
if (typeof window !== 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also check for the existence of fetch? I'm just wondering if there's a case where someone could have have the window object via a bundler, but no fetch and we'd just error out in that case.

@rogebrd rogebrd merged commit 0bdf781 into main Nov 12, 2020
@rogebrd rogebrd deleted the fix_window_v_node branch November 12, 2020 16:04
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.

dbx.filesListFolder - TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
3 participants