Skip to content

Commit

Permalink
add upgrade guide for 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbroos committed Jul 26, 2019
1 parent 42a903a commit fd2b4ab
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Upgrading from 2.x to 3.x

### Change styles path
Styles are moved outside of the src directory so these can be excluded.

`@import '~@freshheads/cookie-guard/src/scss/popup';`

becomes:

`@import '~@freshheads/cookie-guard/styles/popup';`

### No longer use src directory
The src is now typescript, which is no longer published. Use the build by importing `@freshheads/cookie-guard`
This is an ES5 build, but we will soon publish an ES2015 build as well.

### Removed onRevoke callback and selector
The same can be accomplished by making your own selector and calling the cookieConsentStore.

```
revokeButton.addEventListener('click', () => {
cookieGuard.cookieConsentStore.revoke();
window.location.reload();
});
```

But we recommend no longer using revoke but offer users the ability to change their choice by calling accept or refuse on the cookie consent store.

`cookieGuard.cookieConsentStore.accept();`

`cookieGuard.cookieConsentStore.refuse();`


### Renames of some config parameters

Check the new config for the correct naming

0 comments on commit fd2b4ab

Please sign in to comment.