Skip to content

Add a bundle that excludes the web-vitals vendor scripts#411

Open
samuel-holt wants to merge 2 commits intomasterfrom
sh/no-web-vitals-bundle
Open

Add a bundle that excludes the web-vitals vendor scripts#411
samuel-holt wants to merge 2 commits intomasterfrom
sh/no-web-vitals-bundle

Conversation

@samuel-holt
Copy link
Contributor

@samuel-holt samuel-holt commented Jun 14, 2021

Overview

Developers may want to include the web-vitals base and polyfill scripts themselves due to environmental reasons* or to have better control over how the polyfill script is loaded (see the How to use the polyfill section for more details).

*There is a use of Set and WeakSet in the library that can cause issues when trying to support legacy browsers (e.g. older than IE11).

Updates

  • Add a new bundle that excludes the web-vitals vendor scripts in the Gruntfile
  • Update the readme with links to the new bundle

Example usage

<script type="text/javascript">
  !function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){
  (a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0],
  f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){
  h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({
  e:g})}}(window,document,"script","//cdn.raygun.io/raygun4js/raygun.nowebvitals.min.js","rg4js");
</script>

@samuel-holt samuel-holt requested a review from JasenPalmer June 14, 2021 23:41
Copy link
Contributor

@JasenPalmer JasenPalmer left a comment

Choose a reason for hiding this comment

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

Thanks for making this change. Looks good to me

Copy link
Contributor

@mduncan26 mduncan26 left a comment

Choose a reason for hiding this comment

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

Looks good but to be honest raygun4js isnt where my expertise lies.

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.

3 participants