From 966d7198b04952d0973e9d509c358b0cf4d53996 Mon Sep 17 00:00:00 2001 From: Rayus7 Date: Thu, 4 Apr 2024 12:29:44 +0200 Subject: [PATCH] release: publish --- .changeset/few-yaks-scream.md | 23 ------ .changeset/pink-coats-rest.md | 75 ------------------ package-lock.json | 10 +-- .../plugin-analytic-fb-pixel/CHANGELOG.md | 29 +++++++ .../plugin-analytic-fb-pixel/package.json | 4 +- packages/plugin-analytic-google/CHANGELOG.md | 29 +++++++ packages/plugin-analytic-google/package.json | 4 +- packages/plugin-analytic/CHANGELOG.md | 78 +++++++++++++++++++ packages/plugin-analytic/package.json | 2 +- 9 files changed, 146 insertions(+), 108 deletions(-) delete mode 100644 .changeset/few-yaks-scream.md delete mode 100644 .changeset/pink-coats-rest.md diff --git a/.changeset/few-yaks-scream.md b/.changeset/few-yaks-scream.md deleted file mode 100644 index 5811e99e..00000000 --- a/.changeset/few-yaks-scream.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -"@ima/plugin-analytic-fb-pixel": major -"@ima/plugin-analytic-google": major ---- - -Update to new version of @ima/plugin-analytic - -- **What?** - - Update to new version of [@ima/plugin-analytic](https://github.com/seznam/IMA.js-plugins/tree/master/packages/plugin-analytic), which doesn't save `config` argument to class variable anymore. - - Config was moved to first position in dependencies list - - Removed `defaultDependencies` export. - - Typescriptization - - Property `_fbq` is now protected (`#fbq`). - - Removed property `_id` as it was not used anywhere. -- **Why?** - - Adding dependencies to subclasses is easier (no need to copy all dependencies, more info in @ima/plugin-analytic [CHANGELOG](https://github.com/seznam/IMA.js-plugins/blob/master/packages/plugin-analytic/CHANGELOG.md#600)) - - `defaultDependencies` was weird pattern, and we want to get rid of it -- **How?** - - If you extend `FacebookPixelAnalytic` or `GoogleAnalytics4` you need to move `config` parameter to the first position, when calling its `constructor`. - - Replace use of `defaultDependencies` by `$dependencies` property of given class plugin class. - - Replace `_fbq` by `#fbq`. - - **!!** Use only with **@ima/plugin-analytic@6.0.0** or newer. **!!** diff --git a/.changeset/pink-coats-rest.md b/.changeset/pink-coats-rest.md deleted file mode 100644 index 04ccaf69..00000000 --- a/.changeset/pink-coats-rest.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -"@ima/plugin-analytic": major ---- - -Removed config from constructor of `AbstractAnalytic` - -- **What?** - - Removed `defaultDependencies` from plugin. - - Removed config from constructor of `AbstractAnalytic` - - Properties `_loaded`, `_scriptLoader`, `_dispatcher` and method `_afterLoadCallback` are now protected. - (`#loaded`, `#scriptLoader`, `#dispatcher`, `#afterLoadCallback`) - - New method `_isLoaded`. -- **Why?** - - `defaultDependencies` was weird pattern, and we want to get rid of it - - To be able to use spread operator for dependencies in constructor of classes which extends `AbstractAnalytic`. - Until now, we had to repeat all arguments from `AbstractAnalytic` constructor if we wanted to access `config` parameter, which is very common use-case. - Also, now we can work with types in TypeScript more easily. - - To clear the interface of `AbstractAnalytic`. -- **How?** - - Replace use of `defaultDependencies` by `AbstractAnalytic.$dependencies` - - Classes, which extends `AbstractAnalytic` needs to save given config argument on their own. - But you can use rest operator now. - - Therefore, this: - ```javascript - class MyClass extends AbstractAnalytic { - // Even here we were forced to copy dependencies from AbstractAnalytic to specify settings (last value in the array) - static get $dependencies() { - return [ - NonAbstractAnalyticParam, - ScriptLoaderPlugin, - '$Window', - '$Dispatcher', - '$Settings.plugin.analytic.myClass', - ]; - } - - constructor(nonAbstractAnalyticParam, scriptLoader, window, dispatcher, config) { - super(scriptLoader, window, dispatcher, config); - - this._nonAbstractAnalyticParam = nonAbstractAnalyticParam; - - this._id = config.id; // due to this line we were forced to copy all arguments of AbstractAnalytic - - // ... - } - } - ``` - ...can be rewritten to this: - ```javascript - class MyClass extends AbstractAnalytic { - // now we can define only added dependencies and use spread for the rest - static get $dependencies() { - return [ - NonAbstractAnalyticParam, - '$Settings.plugin.analytic.myClass', - ...AbstractAnalytic.$dependencies - ]; - } - - constructor(nonAbstractAnalyticParam, config, ...rest) { - super(...rest); - - this._nonAbstractAnalyticParam = nonAbstractAnalyticParam; - - this._config = config; - - this._id = config.id; - - // ... - } - } - ``` - - Replace use of `_scriptLoader`, `_dispatcher` and `_afterLoadCallback` to `#scriptLoader`, `#dispatcher` and `#afterLoadCallback`. - Check if script is loaded by calling new method `_isLoaded()`. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3544c7d5..0a188507 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21651,7 +21651,7 @@ }, "packages/plugin-analytic": { "name": "@ima/plugin-analytic", - "version": "5.0.7", + "version": "6.0.0", "license": "MIT", "dependencies": { "@ima/plugin-script-loader": "^4.0.0" @@ -21662,10 +21662,10 @@ }, "packages/plugin-analytic-fb-pixel": { "name": "@ima/plugin-analytic-fb-pixel", - "version": "6.0.6", + "version": "7.0.0", "license": "MIT", "dependencies": { - "@ima/plugin-analytic": "^5.0.2" + "@ima/plugin-analytic": "^6.0.0" }, "devDependencies": { "@types/facebook-pixel": "^0.0.30" @@ -21677,10 +21677,10 @@ }, "packages/plugin-analytic-google": { "name": "@ima/plugin-analytic-google", - "version": "7.0.3", + "version": "8.0.0", "license": "MIT", "dependencies": { - "@ima/plugin-analytic": "^5.0.2", + "@ima/plugin-analytic": "^6.0.0", "@ima/plugin-script-loader": "^4.0.0", "@types/gtag.js": "^0.0.19" }, diff --git a/packages/plugin-analytic-fb-pixel/CHANGELOG.md b/packages/plugin-analytic-fb-pixel/CHANGELOG.md index a01e5454..875bd36b 100644 --- a/packages/plugin-analytic-fb-pixel/CHANGELOG.md +++ b/packages/plugin-analytic-fb-pixel/CHANGELOG.md @@ -1,5 +1,34 @@ # Change Log +## 7.0.0 + +### Major Changes + +- ba15bd3: Update to new version of @ima/plugin-analytic + + - **What?** + - Update to new version of [@ima/plugin-analytic](https://github.com/seznam/IMA.js-plugins/tree/master/packages/plugin-analytic), which doesn't save `config` argument to class variable anymore. + - Config was moved to first position in dependencies list + - Removed `defaultDependencies` export. + - Typescriptization + - Property `_fbq` is now protected (`#fbq`). + - Removed property `_id` as it was not used anywhere. + - **Why?** + - Adding dependencies to subclasses is easier (no need to copy all dependencies, more info in @ima/plugin-analytic [CHANGELOG](https://github.com/seznam/IMA.js-plugins/blob/master/packages/plugin-analytic/CHANGELOG.md#600)) + - `defaultDependencies` was weird pattern, and we want to get rid of it + - **How?** + + - If you extend `FacebookPixelAnalytic` or `GoogleAnalytics4` you need to move `config` parameter to the first position, when calling its `constructor`. + - Replace use of `defaultDependencies` by `$dependencies` property of given class plugin class. + - Replace `_fbq` by `#fbq`. + + **!!** Use only with **@ima/plugin-analytic@6.0.0** or newer. **!!** + +### Patch Changes + +- Updated dependencies [8908212] + - @ima/plugin-analytic@6.0.0 + ## 6.0.6 ### Patch Changes diff --git a/packages/plugin-analytic-fb-pixel/package.json b/packages/plugin-analytic-fb-pixel/package.json index 9aae09a8..b75d4396 100644 --- a/packages/plugin-analytic-fb-pixel/package.json +++ b/packages/plugin-analytic-fb-pixel/package.json @@ -1,6 +1,6 @@ { "name": "@ima/plugin-analytic-fb-pixel", - "version": "6.0.6", + "version": "7.0.0", "description": "Seznam IMA.js analytic plugin for Facebook Pixel", "main": "./dist/cjs/main.js", "module": "./dist/esm/main.js", @@ -34,7 +34,7 @@ }, "license": "MIT", "dependencies": { - "@ima/plugin-analytic": "^5.0.2" + "@ima/plugin-analytic": "^6.0.0" }, "peerDependencies": { "@ima/core": ">=18.0.0", diff --git a/packages/plugin-analytic-google/CHANGELOG.md b/packages/plugin-analytic-google/CHANGELOG.md index 89648d75..73ab7433 100644 --- a/packages/plugin-analytic-google/CHANGELOG.md +++ b/packages/plugin-analytic-google/CHANGELOG.md @@ -1,5 +1,34 @@ # Change Log +## 8.0.0 + +### Major Changes + +- ba15bd3: Update to new version of @ima/plugin-analytic + + - **What?** + - Update to new version of [@ima/plugin-analytic](https://github.com/seznam/IMA.js-plugins/tree/master/packages/plugin-analytic), which doesn't save `config` argument to class variable anymore. + - Config was moved to first position in dependencies list + - Removed `defaultDependencies` export. + - Typescriptization + - Property `_fbq` is now protected (`#fbq`). + - Removed property `_id` as it was not used anywhere. + - **Why?** + - Adding dependencies to subclasses is easier (no need to copy all dependencies, more info in @ima/plugin-analytic [CHANGELOG](https://github.com/seznam/IMA.js-plugins/blob/master/packages/plugin-analytic/CHANGELOG.md#600)) + - `defaultDependencies` was weird pattern, and we want to get rid of it + - **How?** + + - If you extend `FacebookPixelAnalytic` or `GoogleAnalytics4` you need to move `config` parameter to the first position, when calling its `constructor`. + - Replace use of `defaultDependencies` by `$dependencies` property of given class plugin class. + - Replace `_fbq` by `#fbq`. + + **!!** Use only with **@ima/plugin-analytic@6.0.0** or newer. **!!** + +### Patch Changes + +- Updated dependencies [8908212] + - @ima/plugin-analytic@6.0.0 + ## 7.0.3 ### Patch Changes diff --git a/packages/plugin-analytic-google/package.json b/packages/plugin-analytic-google/package.json index 8d59ee9b..417682d8 100644 --- a/packages/plugin-analytic-google/package.json +++ b/packages/plugin-analytic-google/package.json @@ -1,6 +1,6 @@ { "name": "@ima/plugin-analytic-google", - "version": "7.0.3", + "version": "8.0.0", "description": "Seznam IMA.js google analytic plugin", "main": "./dist/cjs/main.js", "module": "./dist/esm/main.js", @@ -33,7 +33,7 @@ }, "license": "MIT", "dependencies": { - "@ima/plugin-analytic": "^5.0.2", + "@ima/plugin-analytic": "^6.0.0", "@ima/plugin-script-loader": "^4.0.0", "@types/gtag.js": "^0.0.19" }, diff --git a/packages/plugin-analytic/CHANGELOG.md b/packages/plugin-analytic/CHANGELOG.md index 4405002a..b479c779 100644 --- a/packages/plugin-analytic/CHANGELOG.md +++ b/packages/plugin-analytic/CHANGELOG.md @@ -1,5 +1,83 @@ # Change Log +## 6.0.0 + +### Major Changes + +- 8908212: Removed config from constructor of `AbstractAnalytic` + + - **What?** + - Removed `defaultDependencies` from plugin. + - Removed config from constructor of `AbstractAnalytic` + - Properties `_loaded`, `_scriptLoader`, `_dispatcher` and method `_afterLoadCallback` are now protected. + (`#loaded`, `#scriptLoader`, `#dispatcher`, `#afterLoadCallback`) + - New method `_isLoaded`. + - **Why?** + - `defaultDependencies` was weird pattern, and we want to get rid of it + - To be able to use spread operator for dependencies in constructor of classes which extends `AbstractAnalytic`. + Until now, we had to repeat all arguments from `AbstractAnalytic` constructor if we wanted to access `config` parameter, which is very common use-case. + Also, now we can work with types in TypeScript more easily. + - To clear the interface of `AbstractAnalytic`. + - **How?** + + - Replace use of `defaultDependencies` by `AbstractAnalytic.$dependencies` + - Classes, which extends `AbstractAnalytic` needs to save given config argument on their own. + But you can use rest operator now. + + Therefore, this: + ```javascript + class MyClass extends AbstractAnalytic { + // Even here we were forced to copy dependencies from AbstractAnalytic to specify settings (last value in the array) + static get $dependencies() { + return [ + NonAbstractAnalyticParam, + ScriptLoaderPlugin, + '$Window', + '$Dispatcher', + '$Settings.plugin.analytic.myClass', + ]; + } + + constructor(nonAbstractAnalyticParam, scriptLoader, window, dispatcher, config) { + super(scriptLoader, window, dispatcher, config); + + this._nonAbstractAnalyticParam = nonAbstractAnalyticParam; + + this._id = config.id; // due to this line we were forced to copy all arguments of AbstractAnalytic + + // ... + } + } + ``` + ...can be rewritten to this: + ```javascript + class MyClass extends AbstractAnalytic { + // now we can define only added dependencies and use spread for the rest + static get $dependencies() { + return [ + NonAbstractAnalyticParam, + '$Settings.plugin.analytic.myClass', + ...AbstractAnalytic.$dependencies + ]; + } + + constructor(nonAbstractAnalyticParam, config, ...rest) { + super(...rest); + + this._nonAbstractAnalyticParam = nonAbstractAnalyticParam; + + this._config = config; + + this._id = config.id; + + // ... + } + } + ``` + + - Replace use of `_scriptLoader`, `_dispatcher` and `_afterLoadCallback` to `#scriptLoader`, `#dispatcher` and `#afterLoadCallback`. + Check if script is loaded by calling new method `_isLoaded()`. + ## 5.0.7 ### Patch Changes diff --git a/packages/plugin-analytic/package.json b/packages/plugin-analytic/package.json index b3ac4cd9..63373dc7 100644 --- a/packages/plugin-analytic/package.json +++ b/packages/plugin-analytic/package.json @@ -1,6 +1,6 @@ { "name": "@ima/plugin-analytic", - "version": "5.0.7", + "version": "6.0.0", "description": "Seznam IMA.js abstract analytic plugin", "main": "./dist/cjs/main.js", "module": "./dist/esm/main.js",