Skip to content

Commit

Permalink
Merge pull request #512 from MindscapeHQ/dm/met-1/use-npm-instead-of-…
Browse files Browse the repository at this point in the history
…vendor-polyfill-for-cwv

Update bundle tooling & collect INP WV metric
  • Loading branch information
Olwiba committed Jan 15, 2024
2 parents fe73f53 + bb5228b commit d2a269c
Show file tree
Hide file tree
Showing 15 changed files with 2,128 additions and 559 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Unused normalize.css file
-->
## [3.0.0]

### Added

- Adds Browserify support to build pipeline
- Added new browser mocks for unit tests
- Added new popstate event listener, to trigger
- unloadHandler replacement: Added popstate event listener network logic to [better support mobile devices](https://developer.chrome.com/docs/web-platform/page-lifecycle-api#advice-hidden)
- unloadHandler replacement: Added hidden visibilityState change network logic to [better support mobile devices](https://developer.chrome.com/docs/web-platform/page-lifecycle-api#advice-hidden)

### Changed

- Changed the way the web-vitals library is imported into the project
- Moved to using the official web vital callback triggers
- Updated the sendCoreWebVitalTimings method to fire web vital payloads using beacon if available
- Upgrade chromedriver dependency to 119.0.1

### Removed

- unloadHandler replacement: Removed the unload event listener network logic in favour of other approaches

## [2.28.0]

### Changed
Expand Down Expand Up @@ -785,4 +806,4 @@ NPM and nuget packages (2.25.4 and older) were marked deprecated on NPM and Nuge

## v1.0.1

- Initial Release
- Initial Release
54 changes: 21 additions & 33 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,68 +15,55 @@ module.exports = function(grunt) {
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
browserify: {
dist: {
files: {
'dist/raygun.js': [
'src/useragent.js',
'tracekit/tracekit.js',
'src/raygun.tracekit.jquery.js',
'src/polyfills.js',
'src/raygun.rum/vendor/web-vitals-polyfills.vendor.js',
'src/raygun.utilities/index.js',
'src/raygun.utilities/errorUtilities.js',
'src/raygun.network-tracking.js',
'src/raygun.viewport.js',
'src/raygun.breadcrumbs.js',
'src/raygun.rum/core-web-vitals.js',
'src/raygun.js',
'src/raygun.rum/vendor/web-vitals.vendor.js',
'src/raygun.rum/index.js',
'src/raygun.loader.js'
],
'dist/raygun.vanilla.js': [
'src/useragent.js',
'tracekit/tracekit.js',
'src/polyfills.js',
'src/raygun.rum/vendor/web-vitals-polyfills.vendor.js',
'src/raygun.utilities/index.js',
'src/raygun.utilities/errorUtilities.js',
'src/raygun.network-tracking.js',
'src/raygun.viewport.js',
'src/raygun.breadcrumbs.js',
'src/raygun.rum/core-web-vitals.js',
'src/raygun.js',
'src/raygun.rum/vendor/web-vitals.vendor.js',
'src/raygun.rum/index.js',
'src/raygun.loader.js'
],
'dist/raygun.umd.js': [
'src/useragent.js',
'src/umd.intro.js',
'tracekit/tracekit.js',
'src/polyfills.js',
'src/raygun.rum/vendor/web-vitals-polyfills.vendor.js',
'src/raygun.tracekit.jquery.js',
'src/raygun.utilities/index.js',
'src/raygun.utilities/errorUtilities.js',
'src/raygun.network-tracking.js',
'src/raygun.viewport.js',
'src/raygun.breadcrumbs.js',
'src/raygun.rum/core-web-vitals.js',
'src/raygun.js',
'src/raygun.rum/vendor/web-vitals.vendor.js',
'src/raygun.rum/index.js',
'src/raygun.loader.js',
'src/umd.outro.js'
]
}
}
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: [
'src/umd.intro.js',
'dist/raygun.js',
'src/umd.outro.js'
],
dest: 'dist/raygun.umd.js',
}
},
uglify: {
options: {
banner: '<%= banner %>',
Expand Down Expand Up @@ -112,7 +99,7 @@ module.exports = function(grunt) {
src: {
options: {
jshintrc: 'src/.jshintrc',
ignores: ['src/snippet/**/*.js', 'src/umd.*', 'src/**/*.spec.js', 'src/helpers/*', 'src/raygun.rum/vendor/*.js']
ignores: ['src/snippet/**/*.js', 'src/umd.*', 'src/**/*.spec.js', 'src/helpers/*', 'src/raygun.rum/core-web-vitals.js']
},
src: ['src/**/*.js']
}
Expand Down Expand Up @@ -171,10 +158,11 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadNpmTasks('grunt-browserify');

grunt.registerTask('compile', ['jshint', 'clean', 'concat', 'uglify:dist']);

grunt.registerTask('build', ['jshint', 'clean', 'concat', 'string-replace', 'uglify']);
grunt.registerTask('compile', ['clean', 'browserify', 'jshint', 'concat:dist', 'uglify:dist']);

grunt.registerTask('default', ['compile']);
grunt.registerTask('build', ['clean', 'browserify', 'jshint', 'concat:dist', 'string-replace', 'uglify']);

grunt.registerTask('default', ['build']);
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2017 Raygun Limited
Copyright (c) 2013-2024 Raygun Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Loading

0 comments on commit d2a269c

Please sign in to comment.