tinybase 1.3.0-beta.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/debug/store.d.ts +10 -5
- package/lib/debug/store.js +1 -0
- package/lib/debug/tinybase.js +1 -0
- package/lib/store.d.ts +10 -5
- package/package.json +22 -20
- package/readme.md +1 -1
package/lib/debug/store.d.ts
CHANGED
|
@@ -596,6 +596,10 @@ export type StoreListenerStats = {
|
|
|
596
596
|
* The number of InvalidCellListeners registered with the Store.
|
|
597
597
|
*/
|
|
598
598
|
invalidCell?: number;
|
|
599
|
+
/**
|
|
600
|
+
* The number of TransactionListeners registered with the Store.
|
|
601
|
+
*/
|
|
602
|
+
transaction?: number;
|
|
599
603
|
};
|
|
600
604
|
|
|
601
605
|
/**
|
|
@@ -1798,9 +1802,10 @@ export interface Store {
|
|
|
1798
1802
|
): Return;
|
|
1799
1803
|
|
|
1800
1804
|
/**
|
|
1801
|
-
* The startTransaction allows you to explicitly start a transaction
|
|
1802
|
-
* make multiple mutations to the Store, buffering all calls to the
|
|
1803
|
-
* listeners until it completes when you call the finishTransaction
|
|
1805
|
+
* The startTransaction method allows you to explicitly start a transaction
|
|
1806
|
+
* that will make multiple mutations to the Store, buffering all calls to the
|
|
1807
|
+
* relevant listeners until it completes when you call the finishTransaction
|
|
1808
|
+
* method.
|
|
1804
1809
|
*
|
|
1805
1810
|
* Transactions are useful for making bulk changes to the data in a Store, and
|
|
1806
1811
|
* when you don't want listeners to be called as you make each change. Changes
|
|
@@ -1845,8 +1850,8 @@ export interface Store {
|
|
|
1845
1850
|
startTransaction(): Store;
|
|
1846
1851
|
|
|
1847
1852
|
/**
|
|
1848
|
-
* The finishTransaction allows you to explicitly finish a transaction
|
|
1849
|
-
* has made multiple mutations to the Store, triggering all calls to the
|
|
1853
|
+
* The finishTransaction method allows you to explicitly finish a transaction
|
|
1854
|
+
* that has made multiple mutations to the Store, triggering all calls to the
|
|
1850
1855
|
* relevant listeners.
|
|
1851
1856
|
*
|
|
1852
1857
|
* Transactions are useful for making bulk changes to the data in a Store, and
|
package/lib/debug/store.js
CHANGED
|
@@ -793,6 +793,7 @@ const createStore = () => {
|
|
|
793
793
|
cellIds: collPairSize(cellIdsListeners, collSize3),
|
|
794
794
|
cell: collPairSize(cellListeners, collSize4),
|
|
795
795
|
invalidCell: collPairSize(invalidCellListeners, collSize4),
|
|
796
|
+
transaction: collPairSize(finishTransactionListeners),
|
|
796
797
|
});
|
|
797
798
|
const store = {
|
|
798
799
|
getTables,
|
package/lib/debug/tinybase.js
CHANGED
|
@@ -1814,6 +1814,7 @@ const createStore = () => {
|
|
|
1814
1814
|
cellIds: collPairSize(cellIdsListeners, collSize3),
|
|
1815
1815
|
cell: collPairSize(cellListeners, collSize4),
|
|
1816
1816
|
invalidCell: collPairSize(invalidCellListeners, collSize4),
|
|
1817
|
+
transaction: collPairSize(finishTransactionListeners),
|
|
1817
1818
|
});
|
|
1818
1819
|
const store = {
|
|
1819
1820
|
getTables,
|
package/lib/store.d.ts
CHANGED
|
@@ -596,6 +596,10 @@ export type StoreListenerStats = {
|
|
|
596
596
|
* The number of InvalidCellListeners registered with the Store.
|
|
597
597
|
*/
|
|
598
598
|
invalidCell?: number;
|
|
599
|
+
/**
|
|
600
|
+
* The number of TransactionListeners registered with the Store.
|
|
601
|
+
*/
|
|
602
|
+
transaction?: number;
|
|
599
603
|
};
|
|
600
604
|
|
|
601
605
|
/**
|
|
@@ -1798,9 +1802,10 @@ export interface Store {
|
|
|
1798
1802
|
): Return;
|
|
1799
1803
|
|
|
1800
1804
|
/**
|
|
1801
|
-
* The startTransaction allows you to explicitly start a transaction
|
|
1802
|
-
* make multiple mutations to the Store, buffering all calls to the
|
|
1803
|
-
* listeners until it completes when you call the finishTransaction
|
|
1805
|
+
* The startTransaction method allows you to explicitly start a transaction
|
|
1806
|
+
* that will make multiple mutations to the Store, buffering all calls to the
|
|
1807
|
+
* relevant listeners until it completes when you call the finishTransaction
|
|
1808
|
+
* method.
|
|
1804
1809
|
*
|
|
1805
1810
|
* Transactions are useful for making bulk changes to the data in a Store, and
|
|
1806
1811
|
* when you don't want listeners to be called as you make each change. Changes
|
|
@@ -1845,8 +1850,8 @@ export interface Store {
|
|
|
1845
1850
|
startTransaction(): Store;
|
|
1846
1851
|
|
|
1847
1852
|
/**
|
|
1848
|
-
* The finishTransaction allows you to explicitly finish a transaction
|
|
1849
|
-
* has made multiple mutations to the Store, triggering all calls to the
|
|
1853
|
+
* The finishTransaction method allows you to explicitly finish a transaction
|
|
1854
|
+
* that has made multiple mutations to the Store, triggering all calls to the
|
|
1850
1855
|
* relevant listeners.
|
|
1851
1856
|
*
|
|
1852
1857
|
* Transactions are useful for making bulk changes to the data in a Store, and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
],
|
|
20
20
|
"exports": {
|
|
21
21
|
".": "./lib/tinybase.js",
|
|
22
|
+
"./package.json": "./package.json",
|
|
22
23
|
"./*": "./lib/*.js"
|
|
23
24
|
},
|
|
25
|
+
"react-native": "./lib/tinybase.js",
|
|
24
26
|
"typesVersions": {
|
|
25
27
|
"*": {
|
|
26
28
|
"*": [
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
59
61
|
"@babel/cli": "^7.17.6",
|
|
60
|
-
"@babel/core": "^7.17.
|
|
62
|
+
"@babel/core": "^7.17.9",
|
|
61
63
|
"@babel/preset-env": "^7.16.11",
|
|
62
64
|
"@babel/preset-react": "^7.16.7",
|
|
63
65
|
"@babel/preset-typescript": "^7.16.7",
|
|
@@ -69,25 +71,25 @@
|
|
|
69
71
|
"@types/jest-environment-puppeteer": "^5.0.0",
|
|
70
72
|
"@types/less": "^3.0.3",
|
|
71
73
|
"@types/puppeteer": "^5.4.5",
|
|
72
|
-
"@types/react": "^17.0.
|
|
73
|
-
"@types/react-dom": "^17.0.
|
|
74
|
+
"@types/react": "^17.0.41",
|
|
75
|
+
"@types/react-dom": "^17.0.14",
|
|
74
76
|
"@types/react-test-renderer": "^17.0.1",
|
|
75
77
|
"@types/tmp": "^0.2.3",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
77
|
-
"@typescript-eslint/parser": "^5.
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
|
79
|
+
"@typescript-eslint/parser": "^5.19.0",
|
|
78
80
|
"asciichart": "^1.5.25",
|
|
79
81
|
"babel-eslint": "^10.1.0",
|
|
80
82
|
"babel-jest": "^27.5.1",
|
|
81
83
|
"babel-preset-minify": "^0.5.1",
|
|
82
84
|
"country-flag-emoji-json": "^2.0.0",
|
|
83
|
-
"cspell": "^5.19.
|
|
84
|
-
"esbuild": "^0.14.
|
|
85
|
-
"eslint": "^8.
|
|
85
|
+
"cspell": "^5.19.7",
|
|
86
|
+
"esbuild": "^0.14.36",
|
|
87
|
+
"eslint": "^8.13.0",
|
|
86
88
|
"eslint-config-prettier": "^8.5.0",
|
|
87
|
-
"eslint-plugin-jest": "^26.1.
|
|
88
|
-
"eslint-plugin-jsdoc": "^
|
|
89
|
+
"eslint-plugin-jest": "^26.1.4",
|
|
90
|
+
"eslint-plugin-jsdoc": "^39.2.1",
|
|
89
91
|
"eslint-plugin-react": "^7.29.4",
|
|
90
|
-
"eslint-plugin-react-hooks": "^4.
|
|
92
|
+
"eslint-plugin-react-hooks": "^4.4.0",
|
|
91
93
|
"gulp": "^4.0.2",
|
|
92
94
|
"gulp-gzip": "^1.4.2",
|
|
93
95
|
"http-server": "^14.1.0",
|
|
@@ -95,23 +97,23 @@
|
|
|
95
97
|
"jest-fetch-mock": "^3.0.3",
|
|
96
98
|
"jest-puppeteer": "^6.1.0",
|
|
97
99
|
"less": "^4.1.2",
|
|
98
|
-
"prettier": "^2.6.
|
|
99
|
-
"puppeteer": "^13.5.
|
|
100
|
+
"prettier": "^2.6.2",
|
|
101
|
+
"puppeteer": "^13.5.2",
|
|
100
102
|
"react": "^17.0.2",
|
|
101
103
|
"react-dom": "^17.0.2",
|
|
102
104
|
"react-test-renderer": "^17.0.2",
|
|
103
|
-
"rollup": "^2.70.
|
|
104
|
-
"rollup-plugin-esbuild": "^4.
|
|
105
|
-
"rollup-plugin-gzip": "^3.0.
|
|
105
|
+
"rollup": "^2.70.2",
|
|
106
|
+
"rollup-plugin-esbuild": "^4.9.1",
|
|
107
|
+
"rollup-plugin-gzip": "^3.0.1",
|
|
106
108
|
"rollup-plugin-prettier": "^2.2.2",
|
|
107
109
|
"rollup-plugin-terser": "^7.0.2",
|
|
108
|
-
"tinydocs": "^0.1.
|
|
110
|
+
"tinydocs": "^0.1.12",
|
|
109
111
|
"tmp": "^0.2.1",
|
|
110
112
|
"ts-unused-exports": "^8.0.0",
|
|
111
|
-
"typescript": "4.6.
|
|
113
|
+
"typescript": "4.6.3"
|
|
112
114
|
},
|
|
113
115
|
"peerDependencies": {
|
|
114
|
-
"react": "^17.0.
|
|
116
|
+
"react": "^17.0.0"
|
|
115
117
|
},
|
|
116
118
|
"peerDependenciesMeta": {
|
|
117
119
|
"react": {
|
package/readme.md
CHANGED
|
@@ -192,4 +192,4 @@ console.log(store.getCell('pets', 'felix', 'sold'));
|
|
|
192
192
|
// -> false
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store"><code>store</code></a> module alone, you'll only add a gzipped <em>3.0kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>6.0kB</em>. The <code>ui-react</code> adaptor is just another <em>2.6kB</em>, and everything is fast.</p><p>Life's easy when you have zero dependencies.</p><p>Read more about how TinyBase is structured in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store">store</a></th><td>3.0kB</td><td>6.7kB</td><td>28.
|
|
195
|
+
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store"><code>store</code></a> module alone, you'll only add a gzipped <em>3.0kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>6.0kB</em>. The <code>ui-react</code> adaptor is just another <em>2.6kB</em>, and everything is fast.</p><p>Life's easy when you have zero dependencies.</p><p>Read more about how TinyBase is structured in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store">store</a></th><td>3.0kB</td><td>6.7kB</td><td>28.4kB</td><td>114.5kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes">indexes</a></th><td>1.6kB</td><td>3.2kB</td><td>14.1kB</td><td>32.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics">metrics</a></th><td>1.5kB</td><td>3.1kB</td><td>12.6kB</td><td>29.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships">relationships</a></th><td>1.6kB</td><td>3.2kB</td><td>14.8kB</td><td>42.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints">checkpoints</a></th><td>1.3kB</td><td>2.5kB</td><td>10.3kB</td><td>33.0kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters">persisters</a></th><td>0.8kB</td><td>1.6kB</td><td>4.9kB</td><td>26.7kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/tinybase">tinybase</a></th><td>6.0kB</td><td>14.2kB</td><td>60.0kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible to get up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,004</td><td>1,004</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,094</td><td>1,094</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>417</td><td>417</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>363</td><td>363</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">1,795</td></tr><tr><th class="right">Assertions</th><td colspan="3">8,961</td></tr></tbody></table></div><hr><p><a id="start" href="https://tinybase.org/guides/the-basics/getting-started">Get started</a></p><p><a href="https://tinybase.org/demos">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="follow">Follow</h2><ul><li>News and updates on <a href="https://twitter.com/tinybasejs">Twitter</a> and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://tinybase.org/guides/releases/">Release notes</a> for each minor version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/1.3.2">NPM</a>.</li><li><a href="https://github.com/tinyplex/tinybase/issues">Issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li></ul></section><section><h2 id="about">About</h2><p>Building TinyBase was an interesting exercise in API design, minification, and documentation. It's not <a href="https://www.linkedin.com/in/jamespearce">my day job</a>, but I do intend to maintain it, so please provide feedback. I could not have done this without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it!</p></section>
|