Skip to content

Commit 4e276d7

Browse files
committed
feat: rewrite from scratch
- `provideState + injectState` have been replaced by `withStore` - `withStore` creates a new component from a store definition and a render function - no inheritance, use [React's context](https://reactjs.org/docs/context.html) if necessary - effects can no longer return a reducer, mutate `this.state` instead - all objects (`store`, `state`, `effects`) are sealed to prevent incorrect mutations
1 parent 73013b9 commit 4e276d7

8 files changed

Lines changed: 1280 additions & 752 deletions

File tree

.babelrc.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,29 @@ const __PROD__ = NODE_ENV === "production";
88
const __TEST__ = NODE_ENV === "test";
99

1010
const configs = {
11-
"@babel/plugin-proposal-decorators": {
12-
legacy: true,
11+
"@babel/plugin-proposal-pipeline-operator": {
12+
proposal: "minimal",
1313
},
1414
"@babel/preset-env"(pkg) {
1515
return {
1616
debug: !__TEST__,
1717
loose: true,
1818
shippedProposals: true,
1919
targets: (() => {
20+
const targets = {};
21+
const browers = pkg.browserslist;
22+
if (browers !== undefined) {
23+
targets.browsers = browers;
24+
}
2025
let node = (pkg.engines || {}).node;
2126
if (node !== undefined) {
2227
const trimChars = "^=>~";
2328
while (trimChars.includes(node[0])) {
2429
node = node.slice(1);
2530
}
26-
return { node: node };
31+
targets.node = node;
2732
}
33+
return { browsers: pkg.browserslist, node };
2834
})(),
2935
useBuiltIns: "@babel/polyfill" in (pkg.dependencies || {}) && "usage",
3036
};

.eslintrc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module.exports = {
33
// standard configuration
44
"standard",
55

6+
"plugin:compat/recommended",
7+
68
// https://github.com/mysticatea/eslint-plugin-node#-rules
79
"plugin:node/recommended",
810

@@ -11,8 +13,6 @@ module.exports = {
1113
"prettier/standard",
1214
],
1315

14-
parser: "babel-eslint",
15-
1616
rules: {
1717
// prefer let/const over var
1818
"no-var": "error",
@@ -29,4 +29,8 @@ module.exports = {
2929
// uncomment if you are using a builder like Babel
3030
"node/no-unsupported-features/es-syntax": "off",
3131
},
32+
33+
settings: {
34+
polyfills: ["promises"],
35+
},
3236
};

0 commit comments

Comments
 (0)