@elastic/apm-rum-vue
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.4.0](https://github.com/elastic/apm-agent-rum-js/compare/@elastic/apm-rum-vue@1.3.2...@elastic/apm-rum-vue@1.4.0) (2022-01-10) | ||
### Features | ||
* **rum-vue:** vue 3 support ([#1092](https://github.com/elastic/apm-agent-rum-js/issues/1092)) ([33ef2e4](https://github.com/elastic/apm-agent-rum-js/commit/33ef2e433227b660547962e41afd4693e9166699)) | ||
## [1.3.2](https://github.com/elastic/apm-agent-rum-js/compare/@elastic/apm-rum-vue@1.3.1...@elastic/apm-rum-vue@1.3.2) (2021-12-07) | ||
@@ -8,0 +19,0 @@ |
@@ -1,5 +0,5 @@ | ||
export function getErrorHandler(Vue, apm) { | ||
export function getErrorHandler(app, apm) { | ||
var _this = this; | ||
var previousErrorHandler = Vue.config.errorHandler; | ||
var previousErrorHandler = app.config.errorHandler; | ||
return function (error, vm, info) { | ||
@@ -6,0 +6,0 @@ if (vm && vm.$options) { |
@@ -5,3 +5,3 @@ import { apmBase } from '@elastic/apm-rum'; | ||
export var ApmVuePlugin = { | ||
install: function install(Vue, options) { | ||
install: function install(app, options) { | ||
var router = options.router, | ||
@@ -13,2 +13,3 @@ _options$apm = options.apm, | ||
captureErrors = _options$captureError === void 0 ? true : _options$captureError; | ||
var majorVersion = app.version.split('.').shift(); | ||
apm.init(config); | ||
@@ -22,8 +23,8 @@ | ||
if (captureErrors) { | ||
Vue.config.errorHandler = getErrorHandler(Vue, apm); | ||
app.config.errorHandler = getErrorHandler(app, apm); | ||
} | ||
} | ||
Vue.prototype.$apm = apm; | ||
if (majorVersion >= 3) app.config.globalProperties.$apm = apm;else app.prototype.$apm = apm; | ||
} | ||
}; |
@@ -6,6 +6,6 @@ "use strict"; | ||
function getErrorHandler(Vue, apm) { | ||
function getErrorHandler(app, apm) { | ||
var _this = this; | ||
var previousErrorHandler = Vue.config.errorHandler; | ||
var previousErrorHandler = app.config.errorHandler; | ||
return function (error, vm, info) { | ||
@@ -12,0 +12,0 @@ if (vm && vm.$options) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
var ApmVuePlugin = { | ||
install: function install(Vue, options) { | ||
install: function install(app, options) { | ||
var router = options.router, | ||
@@ -21,2 +21,3 @@ _options$apm = options.apm, | ||
captureErrors = _options$captureError === void 0 ? true : _options$captureError; | ||
var majorVersion = app.version.split('.').shift(); | ||
apm.init(config); | ||
@@ -30,9 +31,9 @@ | ||
if (captureErrors) { | ||
Vue.config.errorHandler = (0, _errorHandler.getErrorHandler)(Vue, apm); | ||
app.config.errorHandler = (0, _errorHandler.getErrorHandler)(app, apm); | ||
} | ||
} | ||
Vue.prototype.$apm = apm; | ||
if (majorVersion >= 3) app.config.globalProperties.$apm = apm;else app.prototype.$apm = apm; | ||
} | ||
}; | ||
exports.ApmVuePlugin = ApmVuePlugin; |
{ | ||
"name": "@elastic/apm-rum-vue", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "Elastic APM Real User Monitoring for Vue applications", | ||
@@ -49,4 +49,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@elastic/apm-rum": "^5.10.0", | ||
"@elastic/apm-rum-core": "^5.13.0" | ||
"@elastic/apm-rum": "^5.10.1", | ||
"@elastic/apm-rum-core": "^5.14.0" | ||
}, | ||
@@ -56,3 +56,3 @@ "browserslist": [ | ||
], | ||
"gitHead": "31c6baf8f6d5628016e0717db198356f4d3439be" | ||
"gitHead": "9d3d9fa8bd7acd83b076115421eb1cb481a1807b" | ||
} |
@@ -26,3 +26,3 @@ /** | ||
export function getErrorHandler(Vue, apm) { | ||
export function getErrorHandler(app, apm) { | ||
/** | ||
@@ -32,3 +32,3 @@ * If the user already installed a global error handler | ||
*/ | ||
const previousErrorHandler = Vue.config.errorHandler | ||
const previousErrorHandler = app.config.errorHandler | ||
@@ -35,0 +35,0 @@ return (error, vm, info) => { |
@@ -31,4 +31,6 @@ /** | ||
export const ApmVuePlugin = { | ||
install: (Vue, options) => { | ||
install: (app, options) => { | ||
const { router, apm = apmBase, config, captureErrors = true } = options | ||
const majorVersion = app.version.split('.').shift() | ||
/** | ||
@@ -52,3 +54,3 @@ * Initialize the APM with the config | ||
*/ | ||
Vue.config.errorHandler = getErrorHandler(Vue, apm) | ||
app.config.errorHandler = getErrorHandler(app, apm) | ||
} | ||
@@ -59,4 +61,7 @@ } | ||
*/ | ||
Vue.prototype.$apm = apm | ||
if (majorVersion >= 3) app.config.globalProperties.$apm = apm | ||
/** | ||
* Backward compatibility with Vue 2 | ||
*/ else app.prototype.$apm = apm | ||
} | ||
} |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
32941
326
1
Updated@elastic/apm-rum@^5.10.1