Skip to content

Use Fetch for url-exists, if available #1424

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

Merged

Conversation

celador
Copy link
Contributor

@celador celador commented Jun 14, 2018

Fixes #1423

Additional description

When checking to see if an icon exists, url-exists is using the standard xmlHttpRequest, which is synchronous, and is deprecated. I added a check to see if fetch is available to the browser, in which case it will use fetch, which is async and standard in modern browsers.

Pull Request Review checklist (do not remove)

  • npm run lint:fix has been run and linting passes.
  • Mocha, Jest (Storyshots), and components/component-docs.json CI tests pass (npm test).
  • Tests have been added for new props to prevent regressions in the future. See readme.
  • Review the appropriate Storybook stories. Open http://localhost:9001/.
  • The Accessibility panel of each Storybook story has 0 violations (aXe). Open http://localhost:9001/.
  • Review tests are passing in the browser. Open http://localhost:8001/.
  • Review markup conforms to SLDS by looking at DOM snapshot strings.
  • Add year-first date and commit SHA to last-slds-markup-review in package.json and push.
  • Request a review of the deployed Heroku app by the Salesforce UX Accessibility Team.
  • Add year-first review date, and commit SHA, last-accessibility-review, to package.json and push.
  • While the contributor's branch is checked out, run npm run local-update within locally cloned site repo to confirm the site will function correctly at the next release.

@celador celador force-pushed the 1423-synchronous-http-request branch from 9f53daf to fb2ec27 Compare June 14, 2018 15:36
@interactivellama interactivellama self-requested a review June 25, 2018 19:54
@interactivellama interactivellama merged commit ec89933 into salesforce:master Jun 25, 2018
@interactivellama
Copy link
Contributor

Thanks, @celador !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning: Synchronous XMLHttpRequest on the main thread is deprecated
2 participants