Skip to content

Commit 9c7d732

Browse files
authored
Merge pull request #172 from cyrilletuzi/v9beta
V9
2 parents ed93664 + 07dd77a commit 9c7d732

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+8453
-9461
lines changed

.github/workflows/main.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
name: Lint check
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v1
11+
- uses: actions/checkout@v2
1212
- name: Setup Node
1313
uses: actions/setup-node@v1
1414
with:
15-
node-version: 10
15+
node-version: 12
1616
- name: Install dependencies
1717
run: npm ci
1818
env:
@@ -30,11 +30,11 @@ jobs:
3030
runs-on: ${{ matrix.os }}
3131

3232
steps:
33-
- uses: actions/checkout@v1
33+
- uses: actions/checkout@v2
3434
- name: Setup Node
3535
uses: actions/setup-node@v1
3636
with:
37-
node-version: 10
37+
node-version: 12
3838
- name: Install dependencies
3939
run: npm ci
4040
env:
@@ -58,25 +58,25 @@ jobs:
5858
run: npm run test:ivy
5959
if: matrix.os == 'ubuntu-latest'
6060

61-
test-backward:
61+
test-next:
6262

63-
name: Test with Angular@8.0 (and [email protected] and [email protected])
63+
name: Test with Angular@next
6464
runs-on: ubuntu-latest
6565

6666
steps:
67-
- uses: actions/checkout@v1
67+
- uses: actions/checkout@v2
6868
- name: Setup Node
6969
uses: actions/setup-node@v1
7070
with:
71-
node-version: 10.9
71+
node-version: 12
7272
- name: Install dependencies
7373
run: npm ci
7474
env:
7575
CI: true
7676
- name: Build the lib (with the current version, as it is what is published on npm)
7777
run: npm run build
7878
- name: Update dependencies to next version
79-
run: npm install [email protected] [email protected] [email protected] @angular/common@8.0.0 @angular/compiler@8.0.0 @angular/core@8.0.0 @angular/platform-browser@8.0.0 @angular/platform-browser-dynamic@8.0.0 @angular/router@8.0.0 @angular/cli@8.0.1 @angular/compiler-cli@8.0.0 @angular-devkit/build-angular@0.800.1 @angular-devkit/build-ng-packagr@0.800.1
79+
run: npm install @angular/common@next @angular/compiler@next @angular/core@next @angular/platform-browser@next @angular/platform-browser-dynamic@next @angular/router@next @angular/cli@next @angular/compiler-cli@next @angular-devkit/build-angular@next @angular-devkit/build-ng-packagr@next
8080
env:
8181
CI: true
8282
- name: Run unit tests
@@ -89,3 +89,39 @@ jobs:
8989
run: npm run test:e2e:demo
9090
- name: Run interoperability e2e tests
9191
run: npm run test:e2e:interoperability
92+
- name: Run Ivy e2e tests
93+
run: npm run test:ivy
94+
95+
test-minimum:
96+
97+
name: Test with [email protected] and minimum dependencies requirements
98+
runs-on: ubuntu-latest
99+
100+
steps:
101+
- uses: actions/checkout@v2
102+
- name: Setup Node
103+
uses: actions/setup-node@v1
104+
with:
105+
node-version: 12
106+
- name: Install dependencies
107+
run: npm ci
108+
env:
109+
CI: true
110+
- name: Build the lib (with the current version, as it is what is published on npm)
111+
run: npm run build
112+
- name: Downgrade dependencies to minimal required version
113+
114+
env:
115+
CI: true
116+
- name: Run unit tests
117+
run: npm run test:unit:ubuntu-latest
118+
- name: Run unit tests in private mode
119+
run: npm run test:unit:ubuntu-latest:private
120+
- name: Install matching webdriver version
121+
run: ./node_modules/.bin/webdriver-manager update --versions.chrome 78.0.3904.70
122+
- name: Run general e2e tests
123+
run: npm run test:e2e:demo
124+
- name: Run interoperability e2e tests
125+
run: npm run test:e2e:interoperability
126+
- name: Run Ivy e2e tests
127+
run: npm run test:ivy

CHANGELOG.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
22

33
This lib is fully documented and so you'll find detailed [migration guides](./MIGRATION.md).
44

5-
## 8.2.4 (2020-01-13)
6-
7-
No code change, just a release built with last Angular 8.
8-
Probably the last before Angular 9.
9-
10-
Also, documentation about [sponsorship](https://github.com/sponsors/cyrilletuzi).
11-
12-
## 9.0.0-rc.1 (2019-11-08)
5+
## 9.0.0 (2020-02-07)
136

14-
To update: `ng update @ngx-pwa/local-storage@next`
7+
To update: `ng update @ngx-pwa/local-storage`
158

16-
A [full migration guide to version 9](https://github.com/cyrilletuzi/angular-async-local-storage/blob/v9beta/docs/MIGRATION_TO_V9.md) is available.
9+
A [full migration guide to version 9](https://github.com/cyrilletuzi/angular-async-local-storage/blob/master/docs/MIGRATION_TO_V9.md) is available.
1710

1811
### Angular 9
1912

@@ -24,12 +17,12 @@ v9 requires Angular 9.
2417
Doing `ng update` should have managed backward compatibility.
2518
But it's not easy to be sure schematics work in all cases,
2619
so **be sure to check the migration was done correctly** by following the
27-
[migration guide to v9](https://github.com/cyrilletuzi/angular-async-local-storage/blob/v9beta/docs/MIGRATION_TO_V9.md), **otherwise you would lost previously stored data**.
20+
[migration guide to v9](https://github.com/cyrilletuzi/angular-async-local-storage/blob/master/docs/MIGRATION_TO_V9.md), **otherwise you would lost previously stored data**.
2821

2922
### Feature
3023

3124
- New `.watch()` method on `StorageMap` service
32-
(see [#108](https://github.com/cyrilletuzi/angular-async-local-storage/pull/108/))
25+
(see [documentation](https://github.com/cyrilletuzi/angular-async-local-storage/blob/master/docs/WATCHING.md))
3326

3427
### Breaking changes: removal of deprecated features
3528

@@ -51,6 +44,13 @@ Please follow the [migration guide to v8](./docs/MIGRATION_TO_V8.md) for more de
5144
- `.removeItemSubscribe()` (use `.removeItem().subscribe()` instead)
5245
- `.clearSubscribe()` (use `.clear().subscribe()` instead)
5346

47+
## 8.2.4 (2020-01-13)
48+
49+
No code change, just a release built with last Angular 8.
50+
Probably the last before Angular 9.
51+
52+
Also, documentation about [sponsorship](https://github.com/sponsors/cyrilletuzi).
53+
5454
## 8.2.3 (2019-09-27)
5555

5656
### Bug fix

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2016-2019 Cyrille Tuzi
3+
Copyright (c) 2016-2020 Cyrille Tuzi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MIGRATION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Migration guides
22

33
- [Migration from the old `angular-async-local-storage` package to `@ngx-pwa/local-storage`](./docs/MIGRATION_TO_NEW_PACKAGE.md)
4-
- [Migration to version 6](./docs/MIGRATION_TO_V6.md)
4+
- [Migration to version 6](./docs/MIGRATION_TO_V6.md) (for Angular 6 & 7)
55
- [Migration to version 8](./docs/MIGRATION_TO_V8.md)
6+
- [Migration to version 9](./docs/MIGRATION_TO_V9.md)
67

78
[Full changelog available here.](./CHANGELOG.md)
89

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ to be homogeneous with other Angular modules.
5858
Install the package, according to your Angular version:
5959

6060
```bash
61-
# For Angular 8:
61+
# For Angular 8 & 9:
6262
ng add @ngx-pwa/local-storage
6363

6464
# For Angular 6 & 7:
@@ -69,7 +69,7 @@ npm install @ngx-pwa/local-storage@6
6969

7070
You should **stick to these commands**. If for any reason `ng add` does not work,
7171
be sure to follow the [manual installation guide](./docs/MANUAL_INSTALLATION.md),
72-
as there are additionnal steps to do in addition to the package installation.
72+
as there are additionnal steps to do in addition to the package installation for some versions.
7373

7474
For version >= 8, if you have multiple applications in the same project, as usual, you need to choose the project:
7575
```bash
@@ -203,11 +203,8 @@ this.storage.get('notexisting').subscribe((data) => {
203203
```
204204

205205
Note you'll only get *one* value: the `Observable` is here for asynchrony but is not meant to
206-
emit again when the stored data is changed. And it's normal: if app data change, it's the role of your app
207-
to keep track of it, not of this lib. See [#16](https://github.com/cyrilletuzi/angular-async-local-storage/issues/16)
208-
for more context and [#4](https://github.com/cyrilletuzi/angular-async-local-storage/issues/4)
209-
for an example. A `watch()` method may come soon
210-
(see [#108](https://github.com/cyrilletuzi/angular-async-local-storage/pull/108))
206+
emit again when the stored data is changed. If you need to watch the value,
207+
version 9 introduced a `watch()` method, see the [watching guide](./docs/WATCHING.md).
211208

212209
### Checking data
213210

@@ -276,7 +273,7 @@ For example, it allows to implement a multiple databases scenario.
276273
### Angular support
277274

278275
We follow [Angular LTS support](https://angular.io/guide/releases),
279-
meaning we support Angular >= 6, until November 2019.
276+
meaning we support Angular >= 7, until April 2020.
280277

281278
This module supports [AoT pre-compiling](https://angular.io/guide/aot-compiler) and Ivy.
282279

angular.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
},
1818
"configurations": {
1919
"production": {
20-
"project": "projects/ngx-pwa/local-storage/ng-package.prod.json"
20+
"project": "projects/ngx-pwa/local-storage/ng-package.prod.json",
21+
"tsConfig": "projects/ngx-pwa/local-storage/tsconfig.lib.prod.json"
2122
}
2223
}
2324
},
@@ -85,7 +86,6 @@
8586
"sourceMap": false,
8687
"extractCss": true,
8788
"namedChunks": false,
88-
"aot": true,
8989
"extractLicenses": true,
9090
"vendorChunk": false,
9191
"buildOptimizer": true,
@@ -94,6 +94,10 @@
9494
"type": "initial",
9595
"maximumWarning": "2mb",
9696
"maximumError": "5mb"
97+
},
98+
{
99+
"type": "anyComponentStyle",
100+
"maximumWarning": "6kb"
97101
}
98102
]
99103
}
@@ -189,7 +193,6 @@
189193
"sourceMap": false,
190194
"extractCss": true,
191195
"namedChunks": false,
192-
"aot": true,
193196
"extractLicenses": true,
194197
"vendorChunk": false,
195198
"buildOptimizer": true,
@@ -198,6 +201,10 @@
198201
"type": "initial",
199202
"maximumWarning": "2mb",
200203
"maximumError": "5mb"
204+
},
205+
{
206+
"type": "anyComponentStyle",
207+
"maximumWarning": "6kb"
201208
}
202209
]
203210
}
@@ -306,7 +313,6 @@
306313
"sourceMap": false,
307314
"extractCss": true,
308315
"namedChunks": false,
309-
"aot": true,
310316
"extractLicenses": true,
311317
"vendorChunk": false,
312318
"buildOptimizer": true,
@@ -315,6 +321,10 @@
315321
"type": "initial",
316322
"maximumWarning": "2mb",
317323
"maximumError": "5mb"
324+
},
325+
{
326+
"type": "anyComponentStyle",
327+
"maximumWarning": "6kb"
318328
}
319329
]
320330
}
@@ -423,7 +433,6 @@
423433
"sourceMap": false,
424434
"extractCss": true,
425435
"namedChunks": false,
426-
"aot": true,
427436
"extractLicenses": true,
428437
"vendorChunk": false,
429438
"buildOptimizer": true,
@@ -432,6 +441,10 @@
432441
"type": "initial",
433442
"maximumWarning": "2mb",
434443
"maximumError": "5mb"
444+
},
445+
{
446+
"type": "anyComponentStyle",
447+
"maximumWarning": "6kb"
435448
}
436449
]
437450
}

browserslist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
# Googlebot uses an older version of Chrome
9+
# For additional information see: https://developers.google.com/search/docs/guides/rendering
10+
11+
> 0.5%
12+
last 2 versions
13+
Firefox ESR
14+
Chrome 41 # Support for Googlebot
15+
not dead
16+
IE 9-11 # For IE 9-11 support, remove 'not'.

docs/INTEROPERABILITY.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ as there are important things to do and to be aware of to achieve interoperabili
1616

1717
## Requirements
1818

19-
Interoperability can be achieved:
20-
- **since v8 of this lib**,
21-
- **only for apps that haven't been deployed in production yet**,
22-
as v8 uses the following opt-in option to allow interoperability:
23-
changing configuration on the fly would mean to **lose all previously stored data**.
19+
Interoperability can be achieved **since v8 of this lib**.
20+
21+
In versions >= 9, no requirement, the new configuration is now the default.
22+
23+
In version 8, you need to add this config:
2424

2525
```ts
2626
import { StorageModule } from '@ngx-pwa/local-storage';
@@ -54,7 +54,7 @@ import { StorageModule } from '@ngx-pwa/local-storage';
5454
@NgModule({
5555
imports: [
5656
StorageModule.forRoot({
57-
IDBNoWrap: true,
57+
IDBNoWrap: true, // Not required in versions >= 9
5858
IDBDBName: 'customDataBaseName',
5959
IDBStoreName: 'customStoreName',
6060
})
@@ -93,6 +93,7 @@ import { StorageModule } from '@ngx-pwa/local-storage';
9393
@NgModule({
9494
imports: [
9595
StorageModule.forRoot({
96+
IDBNoWrap: true, // Not required in versions >= 9
9697
LSPrefix: 'myapp_',
9798
})
9899
]
@@ -118,7 +119,7 @@ import { StorageModule } from '@ngx-pwa/local-storage';
118119
@NgModule({
119120
imports: [
120121
StorageModule.forRoot({
121-
IDBNoWrap: true,
122+
IDBNoWrap: true, // Not required in versions >= 9
122123
LSPrefix: 'localforage/',
123124
IDBDBName: 'localforage',
124125
IDBStoreName: 'keyvaluepairs',

0 commit comments

Comments
 (0)