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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰[RUMF-1544] Fix badly polyfilled URL #2141

Merged
merged 7 commits into from
Apr 6, 2023
Merged

Conversation

amortemousque
Copy link
Contributor

@amortemousque amortemousque commented Apr 5, 2023

Motivation

It has been observed that on some customer website, URL is badly polyfilled. It might not be a constructor, and might not provide a URL.createObjectURL function.

Changes

  • Replace checkURLSupported by getSupportedURL to keep the original URL ref to avoid the URL is not a constructor error in the buildUrl.
  • Check if URL.createObjectURL is supported for the recorder to avoid URL.createObjectURL is not a function error in the worker
  • Add an ESLint rule to force using buildURL instead of new URL. Inspired by no-new-symbol rule

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@amortemousque amortemousque requested review from a team as code owners April 5, 2023 14:39
@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Merging #2141 (374fade) into main (84f6fd5) will decrease coverage by 0.15%.
The diff coverage is 94.11%.

@@            Coverage Diff             @@
##             main    #2141      +/-   ##
==========================================
- Coverage   93.62%   93.47%   -0.15%     
==========================================
  Files         192      192              
  Lines        6005     6009       +4     
  Branches     1345     1350       +5     
==========================================
- Hits         5622     5617       -5     
- Misses        383      392       +9     
Impacted Files Coverage 螖
packages/core/src/tools/utils/urlPolyfill.ts 66.66% <92.30%> (+2.66%) 猬嗭笍
packages/rum/src/boot/recorderApi.ts 96.36% <100.00%> (+0.20%) 猬嗭笍

... and 2 files with indirect coverage changes

馃摚 We鈥檙e building smart automated test selection to slash your CI/CD build times. Learn more

@amortemousque amortemousque merged commit 6fae0e8 into main Apr 6, 2023
2 checks passed
@amortemousque amortemousque deleted the aymeric/keep-url-ref branch April 6, 2023 14:23
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.

None yet

5 participants