Skip to content

v8 #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 190 commits into from
May 28, 2019
Merged

v8 #76

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
f402492
feat: new JSONSchem, and shortcuts and auto-inference for basic types
cyrilletuzi Jan 27, 2019
a88cab4
revert: remove shortcuts
cyrilletuzi Jan 27, 2019
582f972
tests: fix typo
cyrilletuzi Jan 27, 2019
1b614fa
test: test json schema standard support
cyrilletuzi Jan 27, 2019
e3df460
tests: remove unecessary casts
cyrilletuzi Jan 27, 2019
d274bfd
merge commit
cyrilletuzi Jan 27, 2019
199c57b
doc: documentation for v8 validation
cyrilletuzi Jan 27, 2019
ce1ff45
doc: delete old statement
cyrilletuzi Jan 27, 2019
6e70771
tests: fix const tests
cyrilletuzi Jan 27, 2019
8ce0a87
feat: update to TS 3.2
cyrilletuzi Jan 27, 2019
f518717
feat: update peerDependencies to Angular 8 and RxJS 6.3
cyrilletuzi Jan 28, 2019
78c9f5e
revert: rxjs peer 6.0
cyrilletuzi Jan 28, 2019
8163bac
fix: minor updates
cyrilletuzi Jan 28, 2019
2da53df
fix: remove unused deps
cyrilletuzi Jan 28, 2019
5cba136
feat: Angular 8.0.0-beta.1
cyrilletuzi Jan 28, 2019
cd97f1d
build: next tag for beta
cyrilletuzi Jan 28, 2019
022a7a6
docs: update README to v8
cyrilletuzi Jan 28, 2019
60bede9
doc: info about maintenance
cyrilletuzi Jan 28, 2019
47231e5
deps: update to latest beta, pin ts to minor and tsickle to patch
cyrilletuzi Feb 4, 2019
c576497
docs: flag specific JSONSchema interfaces as to be ignored
cyrilletuzi Feb 4, 2019
e13f4f8
Merge branch 'newjsonschema' into v8beta
cyrilletuzi Feb 4, 2019
848a205
docs: migration guide to v8
cyrilletuzi Feb 4, 2019
e8cf02b
feat: disallow null or undefined in setItem
cyrilletuzi Feb 4, 2019
ae91e8f
docs: changelog for v8.0.0-beta.0
cyrilletuzi Feb 4, 2019
8bd2742
lint
cyrilletuzi Feb 4, 2019
5742b25
Merge branch 'nonullorundefined' into v8beta
cyrilletuzi Feb 4, 2019
f94e64e
fix: align app test to new schema
cyrilletuzi Feb 4, 2019
7af8cdf
tests: update to latest tools
cyrilletuzi Feb 5, 2019
1daf1be
feat: allow custom indexeddb database and store names (#78)
cyrilletuzi Feb 5, 2019
4cd56c8
docs: indexeddb db and store names doc
cyrilletuzi Feb 5, 2019
dcaaf2a
refactor: indexeddb
cyrilletuzi Feb 5, 2019
f20d423
docs: info about special chars in options
cyrilletuzi Feb 6, 2019
eea6792
refactor: rename indexedb things
cyrilletuzi Feb 6, 2019
a8d176a
refactor: rename IDB things
cyrilletuzi Feb 6, 2019
054dae7
docs: indentify all storage scenarios
cyrilletuzi Feb 6, 2019
31a272a
refactor: localstorage
cyrilletuzi Feb 6, 2019
57dbf40
refactor: mock storage
cyrilletuzi Feb 6, 2019
c627cdf
refactor: rename mock to memory
cyrilletuzi Feb 6, 2019
717760f
docs
cyrilletuzi Feb 6, 2019
b7f9e78
refactor: jsonvalidator
cyrilletuzi Feb 6, 2019
7278f4c
refactor: main service
cyrilletuzi Feb 6, 2019
32ce819
tests: remove useless validator tests
cyrilletuzi Feb 6, 2019
928c0b1
tests: align to new error message
cyrilletuzi Feb 6, 2019
b2e12e6
feat: better error management and move idb fallback to main service
cyrilletuzi Feb 6, 2019
c0cf472
internal: reduce surface api
cyrilletuzi Feb 6, 2019
02f9144
docs: remove some done todos
cyrilletuzi Feb 6, 2019
ac58b7c
docs: how to force a standard json schema
cyrilletuzi Feb 6, 2019
62711bc
refactor: validator tests
cyrilletuzi Feb 6, 2019
5cb6161
refator: storages tests
cyrilletuzi Feb 6, 2019
26fbeee
feat: export default IDB database and store names
cyrilletuzi Feb 6, 2019
d745ffe
tests
cyrilletuzi Feb 6, 2019
d682737
release: v8.0.0-beta.2
cyrilletuzi Feb 6, 2019
22e40eb
cleanup: remove unecessary e2e project
cyrilletuzi Feb 6, 2019
0b323f1
lint
cyrilletuzi Feb 6, 2019
482fc56
tests: clear localStorage directly
cyrilletuzi Feb 6, 2019
ea82032
docs: add references to issues
cyrilletuzi Feb 7, 2019
dd0eca6
refactor: explicit conditions
cyrilletuzi Feb 7, 2019
04e77cd
docs: add todo
cyrilletuzi Feb 7, 2019
63c26ff
tests: clean indexeddb correctly
cyrilletuzi Feb 7, 2019
9b0afe3
tests: do compilation tests on memory storage
cyrilletuzi Feb 7, 2019
d6e1812
feat: allow usage of idb when in workers
cyrilletuzi Feb 7, 2019
b392f7a
docs: changelog
cyrilletuzi Feb 7, 2019
f4427a6
fix: stringify all keys for interoperability
cyrilletuzi Feb 7, 2019
fe71c5a
docs: info about keys type
cyrilletuzi Feb 7, 2019
b1cb16d
fix: better error management
cyrilletuzi Feb 7, 2019
0a91aed
tests: better compilation tests
cyrilletuzi Feb 7, 2019
5c225fe
feat: new getItem() signature (#79)
cyrilletuzi Feb 7, 2019
585c585
merge commit
cyrilletuzi Feb 7, 2019
8e943a0
docs: migration
cyrilletuzi Feb 7, 2019
3c42132
fix: catch stringify error
cyrilletuzi Feb 7, 2019
ae9d083
fix: catch quota error on localStorage setItem
cyrilletuzi Feb 7, 2019
b3d22ae
fix: different returns in getItem to avoid any future mess
cyrilletuzi Feb 7, 2019
317e38f
fix: catch missing store error
cyrilletuzi Feb 7, 2019
e6cd950
docs: remove done todo
cyrilletuzi Feb 7, 2019
2b6f0cb
deps: Angular 8 beta 3
cyrilletuzi Feb 7, 2019
7f15fa4
release: v8.0.0-beta.3
cyrilletuzi Feb 7, 2019
5ee8f1d
fix: remove getUnsafeItem()
cyrilletuzi Feb 7, 2019
752ee45
merge commit
cyrilletuzi Feb 7, 2019
62350d4
deps: CLI v8.0.0-beta.0
cyrilletuzi Feb 8, 2019
be9cba7
docs: list of errors
cyrilletuzi Feb 8, 2019
8214441
docs: delete ignore on json schema interfaces
cyrilletuzi Feb 8, 2019
710bc38
revert: allow any in setItem()
cyrilletuzi Feb 8, 2019
8411bb5
docs
cyrilletuzi Feb 8, 2019
37117d9
docs
cyrilletuzi Feb 8, 2019
07b32be
docs
cyrilletuzi Feb 8, 2019
582aa06
docs
cyrilletuzi Feb 8, 2019
dc08109
docs
cyrilletuzi Feb 8, 2019
2032a07
docs
cyrilletuzi Feb 8, 2019
0246cfc
tests
cyrilletuzi Feb 8, 2019
6d7c5df
docs
cyrilletuzi Feb 8, 2019
6b59032
docs
cyrilletuzi Feb 8, 2019
2ee33d5
feat: new IDB storing behavior with no wrapping (#82)
cyrilletuzi Feb 11, 2019
b16e1be
fix: typing
cyrilletuzi Feb 11, 2019
62be22e
feat: new store system for interop with backward compat (#84)
cyrilletuzi Feb 13, 2019
a3e05fb
release: 8.0.0-beta.4
cyrilletuzi Feb 13, 2019
b399d82
todos
cyrilletuzi Feb 13, 2019
a3381bf
doc: info for testing types
cyrilletuzi Feb 22, 2019
8b952c8
fix: use observers in subscribe to align with RxJS 6.4 recommendations
cyrilletuzi Feb 23, 2019
b757914
merge commit
cyrilletuzi Feb 25, 2019
8df07c9
tests: move demo app in projects
cyrilletuzi Feb 25, 2019
2e4ad68
deps: update to latest betas
cyrilletuzi Feb 25, 2019
4291276
Merge branch 'master' into v8beta
cyrilletuzi Feb 26, 2019
52d0520
feat: add length alias
cyrilletuzi Mar 10, 2019
9fd39e1
fix: move to rxjs observers when error callback
cyrilletuzi Mar 10, 2019
17b0c19
Merge branch 'master' into v8beta
cyrilletuzi Mar 10, 2019
3f43eca
Merge branch 'master' into v8beta
cyrilletuzi Mar 10, 2019
08cb436
tests: e2e tests
cyrilletuzi Mar 11, 2019
6ea17a6
tests: test against v7
cyrilletuzi Mar 11, 2019
4989a38
tests
cyrilletuzi Mar 11, 2019
3dd7ec7
tests
cyrilletuzi Mar 11, 2019
2123e40
feat: allow ng7 as peerDependency
cyrilletuzi Mar 11, 2019
43d294e
docs: info about versions
cyrilletuzi Mar 11, 2019
f0dcb18
release: v8.0.0-beta.5
cyrilletuzi Mar 11, 2019
e568328
Tuple (#92)
cyrilletuzi Mar 17, 2019
63a942e
feat: removeItem when storing null or undefined (#93)
cyrilletuzi Mar 17, 2019
654d13b
docs: info about serialization (#94)
cyrilletuzi Mar 17, 2019
9a712d4
docs: v8 beta6 changelog
cyrilletuzi Mar 17, 2019
db3a269
release: v8 beta6
cyrilletuzi Mar 17, 2019
154e480
feat: ts 3.3 and last ng v8 beta
cyrilletuzi Mar 21, 2019
debd12c
doc: changelog v8 beta 7
cyrilletuzi Mar 21, 2019
10975f2
release: v8 beta 7
cyrilletuzi Mar 21, 2019
7c2dd76
test: lazy-loading
cyrilletuzi Mar 21, 2019
9f56d28
feat: last cli beta
cyrilletuzi Mar 22, 2019
33006b5
merge commit
cyrilletuzi Mar 25, 2019
0c67b9e
feat: remove xSubscribe() methods (#96)
cyrilletuzi Mar 25, 2019
af8546e
tests: remove tests concerning last pr
cyrilletuzi Mar 25, 2019
188ad02
feat: last betas, align lint to cli, ng-packagr@5
cyrilletuzi Mar 28, 2019
318e15a
tests: ci config
cyrilletuzi Mar 28, 2019
7504e54
tests: ci config
cyrilletuzi Mar 28, 2019
71b266f
tests: better e2e test
cyrilletuzi Apr 3, 2019
f7d1d43
tests: revert to core-js@2 until cli support
cyrilletuzi Apr 3, 2019
2c5db85
tests: temp fix for non interactive cli in ci
cyrilletuzi Apr 3, 2019
e633c99
tests: update webdriver for e2e tests
cyrilletuzi Apr 3, 2019
8640d05
tests: e2e test in firefox too
cyrilletuzi Apr 3, 2019
7e16f2c
feat: update to last betas
cyrilletuzi Apr 22, 2019
4dbe90f
fix: keep old TestBed API for CI
cyrilletuzi Apr 22, 2019
b1253cd
fix: go back to normal npm install in ci
cyrilletuzi Apr 22, 2019
e8b2aa9
fix: revert to ignore-scripts, cli still brokes ci
cyrilletuzi Apr 22, 2019
99c8ce8
feat: separate localStorage and Map APIs (#100)
cyrilletuzi Apr 24, 2019
534f272
fix: reintroduce xSubscribe methods but deprecated
cyrilletuzi Apr 24, 2019
b10177c
release: v8 beta8
cyrilletuzi Apr 24, 2019
1827bbf
deps: update to last betas
cyrilletuzi Apr 24, 2019
32146a0
release: v8 beta9
cyrilletuzi Apr 24, 2019
5d2ac31
doc: todos
cyrilletuzi Apr 26, 2019
03075c8
feat: Angular v8 rc0
cyrilletuzi Apr 26, 2019
3dab749
ci: back to classic config
cyrilletuzi Apr 26, 2019
7c027e1
ci: test with rxjs@6.0.0
cyrilletuzi Apr 26, 2019
0322690
ci: exact versions
cyrilletuzi Apr 26, 2019
250282c
ci: fix cli 7 version
cyrilletuzi Apr 26, 2019
3f28b72
ci: correct versions
cyrilletuzi Apr 26, 2019
c314db1
ci: remove es5 option not supported by old CLI
cyrilletuzi Apr 26, 2019
4f2cab3
feat: rxjs 6.4 as minimum
cyrilletuzi Apr 26, 2019
6a24100
release: v8 beta.10
cyrilletuzi Apr 26, 2019
578d1b8
doc: todos
cyrilletuzi Apr 26, 2019
ee35788
test: ivy (#102)
cyrilletuzi Apr 27, 2019
589a85f
feat: ng v8 rc1
cyrilletuzi Apr 27, 2019
8319278
fix: align to v8 browserslist config
cyrilletuzi Apr 27, 2019
50c251f
tests: align to v8 e2e structure
cyrilletuzi Apr 27, 2019
75dffc1
fix: align project name to CLI constraints
cyrilletuzi Apr 27, 2019
9b92065
fix: use openKeyCursor() when possible for perf
cyrilletuzi Apr 27, 2019
0616a03
feat: schema option in set()
cyrilletuzi Apr 27, 2019
bbecc17
fix: cleaner get() overloads
cyrilletuzi Apr 27, 2019
1697d38
fix: last RC
cyrilletuzi May 10, 2019
6dd2120
release: v8 beta.11
cyrilletuzi May 10, 2019
b9c38b0
feat: drop support for Angular 7, following #103
cyrilletuzi May 13, 2019
849782e
feat: Angular 8.0.0-rc.4 & ng-packagr 5.2
cyrilletuzi May 17, 2019
1dfe9aa
fix: throw when storing data that can't be serialized in localStorage…
cyrilletuzi May 17, 2019
f21e587
feat: remove deprecated platform-worker test
cyrilletuzi May 24, 2019
7bd222a
feat: Angular 8.0.0-rc.5
cyrilletuzi May 24, 2019
b3f3632
merge
cyrilletuzi May 25, 2019
2c48091
feat: engine and database info + opt-in for unwraped values in idb + …
cyrilletuzi May 26, 2019
2f91d2e
doc
cyrilletuzi May 26, 2019
efb9474
tests: aot everywhere
cyrilletuzi May 26, 2019
3405a73
fix: new interface for new options system
cyrilletuzi May 26, 2019
8ceed41
lint
cyrilletuzi May 26, 2019
6d6b16c
fix: align to cli config
cyrilletuzi May 26, 2019
a1200da
fix: remove old option from new options interface
cyrilletuzi May 27, 2019
e4854b1
revert: back to previous cli config as the new one broke TestBed test
cyrilletuzi May 27, 2019
4eb0053
fix: align to v8 TestBed.get
cyrilletuzi May 27, 2019
fc76ccd
release: v8.0.0-beta.13
cyrilletuzi May 27, 2019
51a7d3a
docs: exampleson all public API
cyrilletuzi May 27, 2019
00e420d
fix: make JSONValidator public again
cyrilletuzi May 27, 2019
63041bb
Merge branch 'master' into v8beta
cyrilletuzi May 27, 2019
274c30b
doc: reference watch PR
cyrilletuzi May 27, 2019
23c5462
doc: link to PR
cyrilletuzi May 27, 2019
ffc68b6
Merge branch 'master' into v8beta
cyrilletuzi May 27, 2019
7fb7d7a
test: ivy fix for ci
cyrilletuzi May 27, 2019
18374c0
docs: remove todos
cyrilletuzi May 27, 2019
20203bf
fix: check if data can be serialized before trying to serialiaze
cyrilletuzi May 28, 2019
9f995bd
fix: test and doc about blob refused in idb in safari private
cyrilletuzi May 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ jobs: # a collection of steps
- checkout
- restore_cache: # special step to restore the dependency cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run: # run tests
name: lint
command: npm run lint
build:
test:
docker: # run the steps with Docker
- image: circleci/node:10 # ...with this image as the primary container; this is where all `steps` will run
- image: circleci/node:10-browsers # ...with this image as the primary container; this is where all `steps` will run
steps: # a collection of executable commands
- checkout
- restore_cache: # special step to restore the dependency cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run: # run tests
name: build
command: npm run build
test:
name: test
command: npm test && npm run test:ivy
ng80:
docker: # run the steps with Docker
- image: circleci/node:10-browsers # ...with this image as the primary container; this is where all `steps` will run
steps: # a collection of executable commands
Expand All @@ -47,17 +47,16 @@ jobs: # a collection of steps
- run:
name: install-npm-wee
command: npm install
- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: downgrade
command: npm run ci:ng80
- run: # run tests
name: test
command: ./node_modules/.bin/ng test @ngx-pwa/local-storage --watch false
command: npm test
workflows:
version: 2
lint_and_build_and_test:
test:
jobs:
- lint
- build
- test
- ng80
71 changes: 59 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,62 @@

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

## 8.0.0-beta.x
## 8.0.0-beta.13 (2019-05-27)

v8 development is tracked in [#76](https://github.com/cyrilletuzi/angular-async-local-storage/pull/76).
**A [full migration guide to version 8](./docs/MIGRATION_TO_V8.md) is available.**

This will be an important release so **beta testers are very welcomed.**
### Angular 8

v8 requires Angular 8.

### Feature: new `StorageMap` service

See the [general documentation](./README.md).

### Feature: validation is much easier!

- The schema used for validation can (and should) be passed directly as the second argument of `getItem()`
- The returned type of `getItem()` is now inferred for basic types (`string`, `number`, `boolean`) and arrays of basic types (`string[]`, `number[]`, `boolean[]`)
- Just use the new `JSONSchema` interface, IntelliSense will adjust itself based on the `type` option

See the new [validation guide](./docs/VALIDATION.md).

### Full review

This lib started as a little project and is now the first Angular library used for local storage.
It was time to do a full review and refactoring, which results in:

- Better error management (see [README](./README.md#errors))
- Better documentation
- Better overall code (= easier to contribute)

### Other features

- `indexedDB` database and object store names default values are exported and can be changed
(see the [interoperability guide](./docs/INTEROPERABILITY.md))
- When trying to store `null` or `undefined`, `removeItem()` instead of just bypassing (meaning the old value was kept)

### Breaking changes

- **`type` now required for array, object, const and enum validation schemas**
- `JSONSchemaNull` removed (useless, `null` doesn't require any validation)
- `JSONSchema` no longer accepts extra properties
- `getUnsafeItem()` is removed (was already deprecated in v7)

### Future breaking changes

- `.has()`, `.keys()` and `.size` are deprecated in `LocalStorage`. They will be removed in v9. They moved to the new `StorageMap` service.
- `JSONSchemaNumeric` deprecated (will be removed in v9)
- `LSGetItemsOptions` deprecated (not necessary anymore, will be removed in v9)
- `LOCAL_STORAGE_PREFIX`, `LocalStorageProvidersConfig` and `localStorageProviders()` deprecated (will be removed in v9). Moved to `StorageModule.forRoot()`
- `setItemSubscribe()`, `removeItemSubscribe()` and `clearSubscribe()` deprecated (will be removed in v9)

### Reduced public API

Should not concern you as it was internal stuff.

- `IndexedDBDatabase` and `LocalStorageDatabase` not exported anymore
- `MockLocalDatabase` renamed and not exported anymore

## 7.4.1 (2019-01-27) / 5.3.6 and 6.2.3 and 7.4.2 (2019-02-25)

Expand All @@ -27,6 +78,8 @@ This will be an important release so **beta testers are very welcomed.**
- `has()` and `keys()` now work in Edge/IE too
(fixes [#69](https://github.com/cyrilletuzi/angular-async-local-storage/issues/69))

Do *not* use: it's deprecated in v8.

## 7.3.0 (2019-01-03)

### Feature
Expand Down Expand Up @@ -59,6 +112,8 @@ This will be an important release so **beta testers are very welcomed.**

In v7.2, `has()` and `keys()` were not supported in Internet Explorer and Edge. Update to v7.4.

Do *not* use: it's deprecated in v8.

See [documentation](./docs/MAP_OPERATIONS.md).

### Breaking change (from v7.1 only)
Expand Down Expand Up @@ -87,7 +142,7 @@ These releases have been **deprecated** due to a critical regression.
- `JSONSchemaConst`
- `JSONSchemaEnum`
- `JSONSchemaString`
- `JSONSchemaNumeric`
- `JSONSchemaNumeric` (deprecated in v8)
- `JSONSchemaBoolean`
- `JSONSchemaArray`
- `JSONSchemaObject`
Expand Down Expand Up @@ -133,8 +188,6 @@ Validation of data is now required when using `getItem()`:

- New JSON Schema validation options supported (see [#18](https://github.com/cyrilletuzi/angular-async-local-storage/issues/18) for the full list).

- `setItemSubscribe()`, `removeItemSubscribe()`, `clearSubscribe()` methods for auto-subscription

- `localStorageProviders({ prefix: 'myapp' })` to avoid collision in multiple apps on same subdomain

### Breaking changes
Expand Down Expand Up @@ -206,12 +259,6 @@ If you want to keep your previous data, double the prefix, for example: `localSt

- `localStorageProviders({ prefix: 'myapp' })` to avoid collision in multiple apps on same subdomain

## 5.2.0 (2018-04-08)

### Feature

- `setItemSubscribe()`, `removeItemSubscribe()`, `clearSubscribe()` methods for auto-subscription

## 5.1.1 (2018-04-07)

### Bug fix
Expand Down
1 change: 1 addition & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [Migration from the old `angular-async-local-storage` package to `@ngx-pwa/local-storage`](./docs/MIGRATION_TO_NEW_PACKAGE.md)
- [Migration to version 6](./docs/MIGRATION_TO_V6.md)
- [Migration to version 7](./docs/MIGRATION_TO_V7.md)
- [Migration to version 8](./docs/MIGRATION_TO_V8.md)

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

Expand Down
Loading