Skip to content

Commit

Permalink
release: publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayus7 committed Apr 4, 2024
1 parent 66ef0fa commit 966d719
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 108 deletions.
23 changes: 0 additions & 23 deletions .changeset/few-yaks-scream.md

This file was deleted.

75 changes: 0 additions & 75 deletions .changeset/pink-coats-rest.md

This file was deleted.

10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions packages/plugin-analytic-fb-pixel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-analytic-fb-pixel/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
29 changes: 29 additions & 0 deletions packages/plugin-analytic-google/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-analytic-google/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
78 changes: 78 additions & 0 deletions packages/plugin-analytic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-analytic/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 966d719

Please sign in to comment.