Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
9994d65
Merge pull request #148 from agile-ts/master
bennobuilder May 15, 2021
bdd48c9
made Collection Item primaryKey optional with warning
bennobuilder May 23, 2021
cd45a87
started outsourcing logs
bennobuilder May 24, 2021
3ad5dca
added initialRebuild config to Group
bennobuilder May 24, 2021
4e80ba8
added initialRebuild config to Group
bennobuilder May 24, 2021
ec761a1
removed most of the loggingHandler and added some kind of log code '0…
bennobuilder May 24, 2021
0277f68
removed logging handler
bennobuilder May 25, 2021
1d404e7
added replace method to logCode.ts
bennobuilder May 25, 2021
bcdd760
started moving to id based log handling
bennobuilder May 25, 2021
1d5ec3a
fixed collection log tests
bennobuilder May 25, 2021
821ffe2
fixed typo and added counter example
bennobuilder May 25, 2021
2b92538
fixed collection tests
bennobuilder May 26, 2021
05a78f5
fixed typos
bennobuilder May 26, 2021
a5efe3a
fixed selector and item tests
bennobuilder May 26, 2021
2e4cdfa
added reselect tests
bennobuilder May 26, 2021
5b206a4
Merge pull request #150 from agile-ts/outsource-logs
bennobuilder May 26, 2021
e63544c
added isPlaceholder check
bennobuilder May 26, 2021
da826d9
added config to removeItems
bennobuilder May 27, 2021
de75b14
fixed tests
bennobuilder May 27, 2021
3e20f06
expanded hasSelected tests
bennobuilder May 27, 2021
009f7b1
Merge pull request #152 from agile-ts/fix-remove-selected-item-loop
bennobuilder May 27, 2021
1b0d7af
updated computed method descriptions
bennobuilder May 28, 2021
cfeae99
fixed typos
bennobuilder May 29, 2021
924bfb7
added storage logs
bennobuilder May 29, 2021
0ca8245
outsourced storage sideEffects
bennobuilder May 29, 2021
4610a0c
fixed typos
bennobuilder May 29, 2021
f73d6b4
started fixing collection persistent tests
bennobuilder May 29, 2021
a4e2d3d
added collection persistent setupSideEffect tests
bennobuilder May 29, 2021
32d2426
fixed typos
bennobuilder May 30, 2021
3227b6a
fixed collection persist tests
bennobuilder May 30, 2021
7d34ad3
added assignItem tests
bennobuilder May 30, 2021
f31c043
fixed persist tests
bennobuilder May 30, 2021
8a7ff48
fixed collect method tests
bennobuilder May 31, 2021
1b3a5d8
fixed typos
bennobuilder Jun 1, 2021
37d1495
fixed typos
bennobuilder Jun 2, 2021
f81ce35
fixed collection tests
bennobuilder Jun 2, 2021
9a119d7
fixed typos
bennobuilder Jun 2, 2021
6df7e3f
fixed typos in Collection
bennobuilder Jun 3, 2021
cfd9f2c
added interface descriptions in Collection
bennobuilder Jun 3, 2021
1dd9f3f
fixed typos
bennobuilder Jun 3, 2021
74a86ef
added item method descriptions
bennobuilder Jun 4, 2021
af4e259
added descriptions to Group
bennobuilder Jun 4, 2021
44966aa
refactored the selector method descriptions
bennobuilder Jun 4, 2021
8c14b12
fixed typos
bennobuilder Jun 4, 2021
9313d8c
fixed Collection persistent storage key issue
bennobuilder Jun 4, 2021
a6de58f
fixed typos
bennobuilder Jun 5, 2021
61b2ee6
fixed typos
bennobuilder Jun 6, 2021
305f553
refactored the selector method descriptions
bennobuilder Jun 6, 2021
d924925
added weakmap based selectors to SubscriptionContainer
bennobuilder Jun 6, 2021
c502516
fixed typos
bennobuilder Jun 6, 2021
1d44eb9
fixed some more typos
bennobuilder Jun 6, 2021
aa98046
fixed typos
bennobuilder Jun 6, 2021
91c6ae3
fixed typos
bennobuilder Jun 7, 2021
bd95ed8
fixed typos
bennobuilder Jun 7, 2021
f458fd1
fixed typos
bennobuilder Jun 7, 2021
ea35b95
fixed typos
bennobuilder Jun 8, 2021
2e25a44
optimized subscription controller
bennobuilder Jun 8, 2021
f1f0806
fixed typos
bennobuilder Jun 8, 2021
9c3a9ac
fixed adding Item before 'isInstantiated = true' issue
bennobuilder Jun 9, 2021
66aa53a
documented loading collection value prints many warnings issue in code
bennobuilder Jun 9, 2021
326e6ff
added basic tests for SubscriptionContainer
bennobuilder Jun 9, 2021
5556af0
added basic subController tests
bennobuilder Jun 9, 2021
6c698a9
split the updateSubscription method monster into smaller peaces for b…
bennobuilder Jun 9, 2021
b456ea9
optimized runtime tests
bennobuilder Jun 10, 2021
7cf329f
added basic extractToUpdateSubscriptionContainer tests
bennobuilder Jun 10, 2021
a640755
fixed runtime tests
bennobuilder Jun 10, 2021
faf3fc7
fixed typos
bennobuilder Jun 10, 2021
646f076
fixed typos
bennobuilder Jun 11, 2021
b0bb0f1
fixed SubscriptionContainer typos
bennobuilder Jun 11, 2021
bfd78a8
fixed typos
bennobuilder Jun 11, 2021
4714496
fixed typos in runtime.ts
bennobuilder Jun 12, 2021
55e496a
fixed typos
bennobuilder Jun 12, 2021
083fc45
Merge pull request #154 from agile-ts/optimise-runtime
bennobuilder Jun 12, 2021
2a2e75c
optimized state observer method descriptions
bennobuilder Jun 12, 2021
0c2cd5e
fixed typos
bennobuilder Jun 12, 2021
97e03ce
fixed typos
bennobuilder Jun 12, 2021
4824a13
fixed tests
bennobuilder Jun 12, 2021
4534b73
fixed descritpion for agile class
bennobuilder Jun 13, 2021
5bcd122
fixed descriptions for Integration/s class
bennobuilder Jun 13, 2021
56d42f3
fixed typos
bennobuilder Jun 13, 2021
598d607
added size-limit
bennobuilder Jun 15, 2021
1585c4b
fixed typos in Storages Class
bennobuilder Jun 16, 2021
fa7ec0e
fixed typo
bennobuilder Jun 17, 2021
e9c2b99
optimised descriptions in Persistent
bennobuilder Jun 17, 2021
95948a7
fixed typos
bennobuilder Jun 18, 2021
b32db79
Merge pull request #153 from agile-ts/optimise-descriptions
bennobuilder Jun 18, 2021
4ad078f
added basic async to computed
bennobuilder Jun 19, 2021
cf8e7d0
fixed typos
bennobuilder Jun 19, 2021
b001292
fixed async functionality
bennobuilder Jun 19, 2021
9bd04f1
fixed computed tests
bennobuilder Jun 19, 2021
77e92c2
fixed tests
bennobuilder Jun 19, 2021
2170268
Merge pull request #159 from agile-ts/compute-async
bennobuilder Jun 19, 2021
6ed7d7d
added null option to Selector
bennobuilder Jun 19, 2021
af0ca19
fixed loaded Item from Storage isn't selected
bennobuilder Jun 20, 2021
2013bcc
fixed tests
bennobuilder Jun 20, 2021
dc32d12
removed 'unknownItemPlaceholderKey' and replaced it with 'null'
bennobuilder Jun 20, 2021
c9979e0
Merge pull request #160 from agile-ts/select_null_with_selector
bennobuilder Jun 20, 2021
5f69886
added Group Observer
bennobuilder Jun 20, 2021
6fe58dc
Added group observer
bennobuilder Jun 20, 2021
23da594
made vue integration work with split observers
bennobuilder Jun 20, 2021
6ccfca2
made extracting value or output optional
bennobuilder Jun 20, 2021
7ce64a5
Outsourced extract relevant observers
bennobuilder Jun 20, 2021
9172752
implemented extract relevant observers into React integration
bennobuilder Jun 21, 2021
313c176
fixed vue example
bennobuilder Jun 21, 2021
7ad0b0b
added useOutput and useValue
bennobuilder Jun 21, 2021
53ee465
added rough boxes example (not working yet)
bennobuilder Jun 21, 2021
3f41fec
added basic useSelector
bennobuilder Jun 22, 2021
227901b
fixed useSelector type
bennobuilder Jun 22, 2021
1490be3
made proxy tree in react package optional
bennobuilder Jun 22, 2021
886a203
removed items from Group
bennobuilder Jun 23, 2021
65cbdc3
fixed some tests
bennobuilder Jun 23, 2021
9049260
expanded group observer tests
bennobuilder Jun 23, 2021
66890e2
fixed some more tests
bennobuilder Jun 24, 2021
652cdb6
fixed state observer tests
bennobuilder Jun 24, 2021
27f9266
added extractObservers function tests
bennobuilder Jun 24, 2021
0681544
added extractRelevantObservers tests
bennobuilder Jun 24, 2021
06225ab
fixed typos
bennobuilder Jun 25, 2021
76929be
added optionalRequire util function
bennobuilder Jun 25, 2021
af35f56
fixed tests
bennobuilder Jun 25, 2021
bff4fc2
fixed typos
bennobuilder Jun 26, 2021
a955913
fixed multieditor error
bennobuilder Jun 26, 2021
79807bc
Merge pull request #161 from agile-ts/experimental-subscribe-to-group…
bennobuilder Jun 26, 2021
855a921
bumped version
bennobuilder Jun 26, 2021
283a4ac
fixed proxy error message
bennobuilder Jun 26, 2021
d8df0d4
temporary fixed the import issue
bennobuilder Jun 27, 2021
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
37 changes: 37 additions & 0 deletions .changeset/brave-kiwis-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
'@agile-ts/core': minor
'@agile-ts/react': minor
'@agile-ts/vue': minor
'@agile-ts/api': patch
'cra-template-agile': patch
'cra-template-agile-typescript': patch
'@agile-ts/event': patch
'@agile-ts/logger': patch
'@agile-ts/multieditor': patch
'@agile-ts/proxytree': patch
'@agile-ts/utils': patch
---

#### :rocket: New Feature
* `core`, `multieditor`, `react`, `vue`
* [#161](https://github.com/agile-ts/agile/pull/161) Subscribe to Group value or output ([@bennodev19](https://github.com/bennodev19))
* `core`
* [#160](https://github.com/agile-ts/agile/pull/160) added null option to Selector ([@bennodev19](https://github.com/bennodev19))
* [#159](https://github.com/agile-ts/agile/pull/159) make compute method async compatible ([@bennodev19](https://github.com/bennodev19))

#### :bug: Bug Fix
* `core`
* [#152](https://github.com/agile-ts/agile/pull/152) Fix remove selected Item loop ([@bennodev19](https://github.com/bennodev19))

#### :nail_care: Polish
* `core`, `multieditor`, `react`, `vue`
* [#161](https://github.com/agile-ts/agile/pull/161) Subscribe to Group value or output ([@bennodev19](https://github.com/bennodev19))
* `core`, `cra-template-agile-typescript`, `cra-template-agile`, `event`, `logger`, `multieditor`, `proxytree`, `react`, `utils`, `vue`
* [#153](https://github.com/agile-ts/agile/pull/153) refactor core descriptions ([@bennodev19](https://github.com/bennodev19))
* `core`, `event`, `react`, `vue`
* [#154](https://github.com/agile-ts/agile/pull/154) Optimise Runtime ([@bennodev19](https://github.com/bennodev19))
* `core`, `proxytree`
* [#150](https://github.com/agile-ts/agile/pull/150) Outsource log messages ([@bennodev19](https://github.com/bennodev19))

#### Committers: 1
- BennoDev ([@bennodev19](https://github.com/bennodev19))
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
title: Next Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const App = new Agile();
const MY_FIRST_STATE = App.createState("Hello Friend!");


// -- myComponent.whatever ------------------------------------------
// -- MyComponent.whatever ------------------------------------------

// 3️⃣ Bind initialized State to desired UI-Component
// And wolla, it's reactive. Everytime the State mutates the Component rerenders
Expand Down Expand Up @@ -82,8 +82,10 @@ Besides States, AgileTs offers some other powerful APIs that make your life easi
The philosophy behind AgileTs is simple:

### 🚅 Straightforward

Write minimalistic, boilerplate-free code that captures your intent.
```ts
const MY_STATE = App.createState('frank'); // Create State
MY_STATE.set('jeff'); // Update State value
MY_STATE.undo(); // Undo latest State value change
MY_STATE.is({hello: "jeff"}); // Check if State has the value '{hello: "jeff"}'
Expand All @@ -101,6 +103,7 @@ MY_STATE.watch((value) => {console.log(value);}); // Watch on State changes
const MY_COLLECTION = App.createCollection();
MY_COLLECTION.collect({id: 1, name: "Frank"});
MY_COLLECTION.collect({id: 2, name: "Dieter"});
MY_COLLECTION.update(1, {name: "Jeff"});
```
- Compute State depending on other States
```ts
Expand Down
1 change: 0 additions & 1 deletion examples/react/develop/functional-component-ts/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SKIP_PREFLIGHT_CHECK=true
BROWSER=chrome
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"install:agile": "yalc add @agile-ts/core @agile-ts/react @agile-ts/api @agile-ts/multieditor @agile-ts/event & yarn install"
"install:agile": "yalc add @agile-ts/core @agile-ts/react @agile-ts/api @agile-ts/multieditor @agile-ts/event @agile-ts/proxytree & yarn install"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
37 changes: 25 additions & 12 deletions examples/react/develop/functional-component-ts/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useEffect } from 'react';
import './App.css';
import { useAgile, useWatcher, useProxy } from '@agile-ts/react';
import { useAgile, useWatcher, useProxy, useSelector } from '@agile-ts/react';
import { useEvent } from '@agile-ts/event';
import {
COUNTUP,
externalCreatedItem,
MY_COLLECTION,
MY_COMPUTED,
MY_EVENT,
Expand All @@ -12,7 +13,7 @@ import {
MY_STATE_3,
STATE_OBJECT,
} from './core';
import { generateId, globalBind } from '@agile-ts/core';
import { generateId, globalBind, Item } from '@agile-ts/core';

let rerenderCount = 0;
let rerenderCountInCountupView = 0;
Expand Down Expand Up @@ -42,11 +43,14 @@ const App = (props: any) => {
]);
const [myGroup] = useAgile([MY_COLLECTION.getGroupWithReference('myGroup')]);

const [stateObject, item2, collection2] = useProxy([
STATE_OBJECT,
MY_COLLECTION.getItem('id2'),
MY_COLLECTION,
]);
const selectedObjectItem = useSelector(STATE_OBJECT, (value) => {
return value.age;
});

const [stateObject, item2, collection2] = useProxy(
[STATE_OBJECT, MY_COLLECTION.getItem('id2'), MY_COLLECTION],
{ key: 'useProxy' }
);

console.log('Item1: ', item2?.name);
console.log('Collection: ', collection2.slice(0, 2));
Expand Down Expand Up @@ -106,7 +110,8 @@ const App = (props: any) => {
<div className={'Container'}>
<h3 className={'Title'}>My State Object</h3>
<p>
Deep Name: {stateObject.friends.hans.name} {stateObject.location}
Deep Name: {stateObject?.friends?.hans?.name}{' '}
{stateObject?.location}
</p>
<button
onClick={() => {
Expand All @@ -132,21 +137,29 @@ const App = (props: any) => {
<div className={'Container'}>
<h3 className={'Title'}>My Collection</h3>
<div>
{myGroup.map((item) => (
<p key={item.id}>{item.name}</p>
{myGroup?.map((item) => (
<p key={item.key}>{item.name}</p>
))}
</div>
<button
onClick={() => MY_COLLECTION.collect({ id: 'id3', name: 'Test3' })}>
onClick={() =>
MY_COLLECTION.collect({ key: 'id3', name: 'Test3' })
}>
Collect
</button>
<button
onClick={() =>
MY_COLLECTION.collect(externalCreatedItem, ['myGroup'])
}>
Collect external Item
</button>
<button onClick={() => MY_COLLECTION.getGroup('myGroup')?.add('id3')}>
Add to myGroup
</button>
<button
onClick={() =>
MY_COLLECTION.update('id3', {
id: 'newId3',
key: 'newId3',
name: 'Test3_Changed',
})
}>
Expand Down
21 changes: 15 additions & 6 deletions examples/react/develop/functional-component-ts/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Agile, clone, Logger } from '@agile-ts/core';
import { Agile, clone, Item, Logger } from '@agile-ts/core';
import Event from '@agile-ts/event';

export const myStorage: any = {};
Expand Down Expand Up @@ -64,32 +64,41 @@ export const MY_COMPUTED = App.createComputed<string>(() => {
}, []).setKey('myComputed');

interface collectionValueInterface {
id: string;
key: string;
name: string;
}

export const MY_COLLECTION = App.createCollection<collectionValueInterface>(
(collection) => ({
key: 'my-collection',
primaryKey: 'key',
groups: {
myGroup: collection.Group(['id4']),
},
selectors: {
mySelector: collection.Selector('id3'),
},
initialData: [{ id: 'id4', name: 'hans' }],
initialData: [
{ key: 'id4', name: 'hans' } as any,
{ key: 'frank', name: 'frank' },
],
})
).persist();
MY_COLLECTION.collect({ id: 'id1', name: 'test' });
MY_COLLECTION.collect({ id: 'id2', name: 'test2' }, 'myGroup');
MY_COLLECTION.update('id1', { id: 'id1Updated', name: 'testUpdated' });
MY_COLLECTION.collect({ key: 'id1', name: 'test' });
MY_COLLECTION.collect({ key: 'id2', name: 'test2' }, 'myGroup');
MY_COLLECTION.update('id1', { key: 'id1Updated', name: 'testUpdated' });
MY_COLLECTION.getGroup('myGroup')?.persist({
followCollectionPersistKeyPattern: true,
});
MY_COLLECTION.onLoad(() => {
console.log('On Load MY_COLLECTION');
});

export const externalCreatedItem = new Item(MY_COLLECTION, {
key: 'id10',
name: 'test',
}).persist({ followCollectionPersistKeyPattern: true });

console.log('Initial: myCollection ', clone(MY_COLLECTION));

export const MY_EVENT = new Event<{ name: string }>(App, {
Expand Down
46 changes: 23 additions & 23 deletions examples/react/develop/functional-component-ts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,46 @@


"@agile-ts/api@file:.yalc/@agile-ts/api":
version "0.0.16"
version "0.0.18"
dependencies:
"@agile-ts/utils" "^0.0.2"
"@agile-ts/utils" "^0.0.4"

"@agile-ts/core@file:.yalc/@agile-ts/core":
version "0.0.15"
version "0.0.17"
dependencies:
"@agile-ts/logger" "^0.0.2"
"@agile-ts/utils" "^0.0.2"
"@agile-ts/logger" "^0.0.4"
"@agile-ts/utils" "^0.0.4"

"@agile-ts/event@file:.yalc/@agile-ts/event":
version "0.0.5"
version "0.0.7"

"@agile-ts/logger@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@agile-ts/logger/-/logger-0.0.2.tgz#80a726531dd63ca7d1c9a123383e57b5501efbb0"
integrity sha512-rJJ5pqXtOriYxjuZPhHs2J9N1FnIaAZqItCw0MXW9/5od/uhJ28aiG7w9RUBZts9SjDcICYEfjFMcTJ/kYJsMg==
"@agile-ts/logger@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@agile-ts/logger/-/logger-0.0.4.tgz#7f4d82ef8f03b13089af0878c360575c43f0962d"
integrity sha512-qm0obAKqJMaPKM+c76gktRXyw3OL1v39AnhMZ0FBGwJqHWU+fLRkCzlQwjaROCr3F1XP01Lc/Ls3efF0WzyEPw==
dependencies:
"@agile-ts/utils" "^0.0.2"
"@agile-ts/utils" "^0.0.4"

"@agile-ts/multieditor@file:.yalc/@agile-ts/multieditor":
version "0.0.15"
version "0.0.17"

"@agile-ts/proxytree@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@agile-ts/proxytree/-/proxytree-0.0.2.tgz#516ed19ee8d58aeecb291788a1e47be3dc23df8c"
integrity sha512-PbSiChF0GcUoWnrbnHauzBxZ5r/+4pZSZWpYjkBcIFa48DgTtFzg5DfQzsW3Rc1Y0QSFGYqcZOvCK1xAjLIQ2g==
"@agile-ts/proxytree@^0.0.3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@agile-ts/proxytree/-/proxytree-0.0.3.tgz#e3dacab123a311f2f0d4a0369793fe90fdab7569"
integrity sha512-auO6trCo7ivLJYuLjxrnK4xuUTangVPTq8UuOMTlGbJFjmb8PLEkaXuRoVGSzv9jsT2FeS7KsP7Fs+yvv0WPdg==

"@agile-ts/proxytree@file:.yalc/@agile-ts/proxytree":
version "0.0.1"
version "0.0.3"

"@agile-ts/react@file:.yalc/@agile-ts/react":
version "0.0.16"
version "0.0.18"
dependencies:
"@agile-ts/proxytree" "^0.0.2"
"@agile-ts/proxytree" "^0.0.3"

"@agile-ts/utils@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@agile-ts/utils/-/utils-0.0.2.tgz#5f03761ace569b6c9ddd28c22f7b0fbec8b006b1"
integrity sha512-LqgQyMdK+zDuTCmOX6FOxTH4JNXhEvGFqIyNqRDoP99BK6MHGrK+n7nOW+1b4x6ZCYe0+VmwtG5CeOPOm3Siow==
"@agile-ts/utils@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@agile-ts/utils/-/utils-0.0.4.tgz#66e9536e561796489a37155da6b74ce2dc482697"
integrity sha512-GiZyTYmCm4j2N57oDjeMuPpfQdgn9clb0Cxpfuwi2Bq5T/KPXlaROLsVGwHLjwwT+NX7xxr5qNJH8pZTnHnYRQ==

"@babel/code-frame@7.8.3":
version "7.8.3"
Expand Down
1 change: 1 addition & 0 deletions examples/react/develop/simple-counter/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
2 changes: 2 additions & 0 deletions examples/react/develop/simple-counter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
node_modules
9 changes: 9 additions & 0 deletions examples/react/develop/simple-counter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Simple Counter

This app was created to compare different bundle sizes of projects using a third party State-Manager.
https://twitter.com/dai_shi/status/1396976791940595713?s=20

- context: https://codesandbox.io/s/react-context-counters-eky4f
- jotai: https://codesandbox.io/s/jotai-counters-zn16r
- valtio: https://codesandbox.io/s/valtio-counters-y3632
- zustand: https://codesandbox.io/s/zustand-counters-9k48i
34 changes: 34 additions & 0 deletions examples/react/develop/simple-counter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "counter",
"version": "0.1.0",
"private": true,
"dependencies": {
"@agile-ts/core": "^0.0.17",
"@agile-ts/react": "^0.0.18",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-scripts": "4.0.0"
},
"devDependencies": {
"source-map-explorer": "^2.5.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file not shown.
43 changes: 43 additions & 0 deletions examples/react/develop/simple-counter/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Loading