Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit a31a27d

Browse files
authored
Merge pull request #223 from agile-ts/develop
New Release 🎉
2 parents 737b594 + e6ec291 commit a31a27d

File tree

75 files changed

+4327
-5992
lines changed

Some content is hidden

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

75 files changed

+4327
-5992
lines changed

.changeset/chatty-bulldogs-smash.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@agile-ts/api': patch
3+
'@agile-ts/core': patch
4+
'@agile-ts/event': patch
5+
'@agile-ts/logger': patch
6+
'@agile-ts/multieditor': patch
7+
'@agile-ts/proxytree': patch
8+
'@agile-ts/react': patch
9+
'@agile-ts/utils': patch
10+
'@agile-ts/vue': patch
11+
---
12+
13+
#### :bug: Bug Fix
14+
* `core`
15+
* [#220](https://github.com/agile-ts/agile/pull/220) synchronously recompute value after state change ([@leopf](https://github.com/leopf))
16+
17+
#### Committers: 2
18+
- BennoDev ([@bennodev19](https://github.com/bennodev19))
19+
- [@leopf](https://github.com/leopf)

.circleci/config.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
# Following this caching concept https://circleci.com/docs/2.0/persist-data/
2+
# https://circleci.com/docs/language-javascript
23

34
version: 2.1
45

56
orbs:
6-
node: circleci/[email protected]
7-
8-
executors:
9-
node-executor:
10-
docker:
11-
- image: circleci/node:14
7+
node: circleci/[email protected]
128

139
jobs:
1410

1511
build:
16-
executor: node-executor
12+
executor: node/default # Docker environment in what to execute the steps
1713
steps:
1814
# Checkout Project from Github
1915
- checkout
@@ -31,9 +27,9 @@ jobs:
3127
# # fallback to using the latest cache if no exact match is found
3228
# - v1-dependencies-
3329

34-
- run:
35-
name: ⏳ Install
36-
command: yarn install
30+
# - run:
31+
# name: ⏳ Install
32+
# command: yarn install
3733

3834
# Not necessary because of auto caching of circleci/[email protected]
3935
# - save_cache:
@@ -55,7 +51,7 @@ jobs:
5551
paths: [ ./* ]
5652

5753
test:
58-
executor: node-executor
54+
executor: node/default
5955
steps:
6056
# https://circleci.com/docs/2.0/configuration-reference/#attach_workspace
6157
- attach_workspace:
@@ -70,7 +66,7 @@ jobs:
7066
command: yarn run test --runInBand # Tests somehow only get executed with the '--runInBand' Flag
7167

7268
test-coverage:
73-
executor: node-executor
69+
executor: node/default
7470
steps:
7571
# https://circleci.com/docs/2.0/configuration-reference/#attach_workspace
7672
- attach_workspace:

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: 🐛 Bug report
3-
about: Create a report to help us improve AgileTs
3+
about: Create a bug report to help us improve AgileTs
44
title: ''
55
labels: 'Type: Bug'
66
assignees: ''
@@ -11,35 +11,36 @@ assignees: ''
1111

1212
### 🤖 Current Behavior
1313

14-
<!-- Explain your problem (with screenshots, videos, text) in detail -->
14+
<!-- Explain your problem (e.g. with screenshots, text, code snippets) in detail -->
1515

1616
### 🎯 Expected behavior
1717

1818
<!-- A clear and concise description of what you expected to happen. -->
1919

2020
### 📄 Reproducible example
2121

22-
<!-- Create a simple example in Codebox -->
22+
<!-- Create a simple example that reproduces your problem in a code sandbox
23+
(like this one: https://codesandbox.io/s/issue-219-ufcck?file=/src/main.js) -->
2324

2425
### 💡 Suggested solution(s)
2526

26-
<!-- How could we solve this bug? What changes would need to made to AgileTs? -->
27+
<!-- How could we solve this bug? What changes would need to made to AgileTs? Any idea? -->
2728

2829
### ➕ Additional notes
2930

30-
<!-- Add any other context about the problem here. -->
31+
<!-- Add additional context about the problem here. (optional) -->
3132

3233
### 💻 Your environment
3334

34-
<!-- PLEASE FILL THIS OUT -->
35+
<!-- What version/s of AgileTs are you using? -->
3536

3637
| Software | Version(s) |
3738
| ----------------------| ---------- |
38-
| TypeScript |
39-
| npm/Yarn |
40-
| NodeJs |
41-
| @agile-ts/core |
42-
| @agile-ts/react |
43-
| @agile-ts/api |
44-
| @agile-ts/multieditor |
45-
<!-- Any additional important Version Notes? -->
39+
| @agile-ts/core | N/A
40+
| @agile-ts/react | N/A
41+
| @agile-ts/api | N/A
42+
| @agile-ts/multieditor | N/A
43+
| TypeScript | N/A
44+
| npm/Yarn | N/A
45+
| NodeJs | N/A
46+
<!-- Any additional important version notes? -->

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ yarn-debug.log*
1313
yarn-error.log*
1414
.eslintcache
1515
package-lock.json
16-
yarn.lock
1716

1817
# Editor directories and files
1918
.idea

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ Generate a GitHub auth token by going to https://github.com/settings/tokens
233233

234234
Generate the changelog in the `root` of the project with:
235235
```sh
236+
# Linux
236237
GITHUB_AUTH=<Your GitHub auth token> yarn run changelog
238+
239+
# Windows
240+
set GITHUB_AUTH=<Your GitHub auth token> && yarn run changelog
237241
```
238242
Copy the generated content and paste it as a description into the in [Step 3](#3-create-pull-request-to-master)
239243
created `Pull Request`. Save the changelog somewhere in between because we need it again in the next step ([Step 5](#5-bump-version)).

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
> ⚠️ **No longer actively maintained**. If there is more interest and people want to use this package, I will be happy to continue working on it. cheers
2-
>
3-
> ❓ If you've any questions feel free to open a [discussions](https://github.com/agile-ts/agile/discussions).
4-
5-
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/header_background.png" alt="AgileTs">
1+
> ⚠️ **No longer actively maintained**.
2+
> In case there will be a higher demand and more known bugs in the future,
3+
> I will be happy to continue improving this project.
4+
> But as for now its stable and can be used in any sort of project.
5+
> In case you face any problem feel free open an [issue](https://github.com/agile-ts/agile/issues).
6+
>
7+
> ❓ If you've any questions, don't hesitate to start a [discussion](https://github.com/agile-ts/agile/discussions).
8+
9+
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/header_background.png" alt="AgileTs">
610

711
> 🎇 **Global State and Logic Library**
812
@@ -248,3 +252,6 @@ To find out more about contributing, check out the [CONTRIBUTING.md](https://git
248252

249253
AgileTs is inspired by [MVVM Libraries](https://de.wikipedia.org/wiki/Model_View_ViewModel)
250254
like [MobX](https://mobx.js.org/README.html) and [PulseJs](https://github.com/pulse-framework/pulse).
255+
256+
### 🕐 Time spent building this project
257+
[![wakatime](https://wakatime.com/badge/user/aa5a8ce7-1c57-4f26-a159-ea57ec5ea7c1/project/6d1a7308-89b1-4e95-9623-64c0c6116d0a.svg)](https://wakatime.com/badge/user/aa5a8ce7-1c57-4f26-a159-ea57ec5ea7c1/project/6d1a7308-89b1-4e95-9623-64c0c6116d0a)

examples/react/develop/fields/src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export default function App() {
5252
id: FIELDS.size,
5353
name: `Field #${FIELDS.size + 1}`,
5454
});
55-
}}>
55+
}}
56+
>
5657
Add Field
5758
</button>
5859
</div>

examples/react/develop/functional-component-ts/yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33

44

55
"@agile-ts/api@file:.yalc/@agile-ts/api":
6-
version "0.0.24"
6+
version "0.0.25"
77
dependencies:
8-
"@agile-ts/utils" "^0.0.10"
8+
"@agile-ts/utils" "^0.0.11"
99

1010
"@agile-ts/core@file:.yalc/@agile-ts/core":
11-
version "0.2.6"
11+
version "0.2.7"
1212
dependencies:
13-
"@agile-ts/utils" "^0.0.10"
13+
"@agile-ts/utils" "^0.0.11"
1414

1515
"@agile-ts/event@file:.yalc/@agile-ts/event":
16-
version "0.0.13"
16+
version "0.0.14"
1717

1818
"@agile-ts/logger@file:.yalc/@agile-ts/logger":
19-
version "0.0.10"
19+
version "0.0.11"
2020
dependencies:
21-
"@agile-ts/utils" "^0.0.10"
21+
"@agile-ts/utils" "^0.0.11"
2222

2323
"@agile-ts/multieditor@file:.yalc/@agile-ts/multieditor":
24-
version "0.0.23"
24+
version "0.0.24"
2525

2626
"@agile-ts/proxytree@file:.yalc/@agile-ts/proxytree":
27-
version "0.0.8"
27+
version "0.0.9"
2828

2929
"@agile-ts/react@file:.yalc/@agile-ts/react":
30-
version "0.2.2"
30+
version "0.2.3"
3131

32-
"@agile-ts/utils@^0.0.10":
33-
version "0.0.10"
34-
resolved "https://registry.yarnpkg.com/@agile-ts/utils/-/utils-0.0.10.tgz#5eb2d7b7faefc00c416165ad93c79237e8448bbd"
35-
integrity sha512-eVJZS60H8HaD8atTfswObihdDxjcxNlaoHk8Crmz85KOrdIMBMdrGx41p+Zf15s+dSfal1gbgM2In3bw4zjSww==
32+
"@agile-ts/utils@^0.0.11":
33+
version "0.0.11"
34+
resolved "https://registry.yarnpkg.com/@agile-ts/utils/-/utils-0.0.11.tgz#3680407e92528f0e372af28983872c20b80b395c"
35+
integrity sha512-tbrlXbo3ukoODodl4Og99BG/glhk9NUO09LJ7qdQ25/coL13lNzQQix9Z5IFohEIeJ71Y4ZIGzJmmui29FxTKA==
3636

3737
3838
version "7.8.3"

examples/react/develop/simple-todo-list/src/App.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const App = () => {
3030
method: 'unshift', // to add todo at the beginning of the Collection
3131
});
3232
setCurrentInput('');
33-
}}>
33+
}}
34+
>
3435
Add
3536
</button>
3637
{todos.map((value) => (
@@ -41,7 +42,8 @@ const App = () => {
4142
onClick={() => {
4243
// Remove Todo at specific primary Key
4344
TODOS.remove(value.id).everywhere();
44-
}}>
45+
}}
46+
>
4547
Remove
4648
</button>
4749
</div>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"syncDir": "dist",
1818
"scripts": {
1919
"build": "lerna run build",
20-
"prepare": "lerna run prepare",
2120
"changelog": "lerna-changelog",
2221
"bootstrap": "lerna bootstrap",
2322
"watch:core": "cd packages/core && yarn run watch",
@@ -41,7 +40,8 @@
4140
"pack:react": "cd packages/react && yarn run prepare && yarn run pack",
4241
"pack:multieditor": "cd packages/multieditor && yarn run prepare && yarn run pack",
4342
"pack:api": "cd packages/api && yarn run prepare && yarn run pack",
44-
"pack:event": "cd packages/event && yarn run prepare && yarn run pack"
43+
"pack:event": "cd packages/event && yarn run prepare && yarn run pack",
44+
"install:clean": "shx rm -rf yarn.lock && shx rm -rf node_modules && yarn install && lerna run install:clean"
4545
},
4646
"repository": {
4747
"type": "git",

packages/api/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
},
2727
"scripts": {
2828
"build": "shx rm -rf dist && rollup --c rollup.config.js",
29-
"prepare": "yarn run build",
3029
"dev:publish": "yalc publish",
3130
"dev:push": "yalc push",
3231
"watch:push": "tsc-watch --onSuccess \"yarn run dev:push\"",

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
},
3838
"scripts": {
3939
"build": "shx rm -rf dist && rollup --c rollup.config.js",
40-
"prepare": "yarn run build",
4140
"dev:publish": "yalc publish",
4241
"dev:push": "yalc push",
4342
"watch:push": "tsc-watch --onSuccess \"yarn run dev:push\"",

packages/core/src/collection/collection.persistent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from '@agile-ts/utils';
22
import { logCodeManager } from '../logCodeManager';
33
import { Collection, CollectionKey, DefaultItem, ItemKey } from './collection';
4-
import { Group, GroupKey } from './group';
4+
import type { Group, GroupKey } from './group';
55
import {
66
CreatePersistentConfigInterface,
77
getSharedStorageManager,
@@ -137,9 +137,8 @@ export class CollectionPersistent<
137137
// that it was loaded completely.
138138
// After a successful loading assign the now valid Item to the Collection.
139139
else {
140-
const placeholderItem = this.collection().getItemWithReference(
141-
itemKey
142-
);
140+
const placeholderItem =
141+
this.collection().getItemWithReference(itemKey);
143142
placeholderItem?.persist({
144143
key: itemStorageKey,
145144
loadValue: false,
@@ -148,7 +147,8 @@ export class CollectionPersistent<
148147
followCollectionPersistKeyPattern: false, // Because of the dynamic 'storageItemKey', the key is already formatted above
149148
});
150149
if (placeholderItem?.persistent?.ready) {
151-
const loadedPersistedValueIntoItem = await placeholderItem.persistent.loadPersistedValue();
150+
const loadedPersistedValueIntoItem =
151+
await placeholderItem.persistent.loadPersistedValue();
152152

153153
// If successfully loaded Item value, assign Item to Collection
154154
if (loadedPersistedValueIntoItem) {

packages/core/src/collection/collection.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
normalizeArray,
88
} from '@agile-ts/utils';
99
import { logCodeManager } from '../logCodeManager';
10-
import { Agile } from '../agile';
10+
import type { Agile } from '../agile';
1111
import { PatchOptionConfigInterface } from '../state';
12-
import { ComputedTracker } from '../computed';
12+
import { ComputedTracker } from '../computed/computed.tracker'; // Not imported directly from '../computed' due circular dependencies
1313
import { Item } from './item';
1414
import { SelectorConfigInterface, Selector, SelectorKey } from './selector';
1515
import {
@@ -20,7 +20,7 @@ import {
2020
TrackedChangeMethod,
2121
} from './group';
2222
import { GroupIngestConfigInterface } from './group/group.observer';
23-
import { CreatePersistentConfigInterface, StorageKey } from '../storages';
23+
import { CreatePersistentConfigInterface } from '../storages';
2424
import { CollectionPersistent } from './collection.persistent';
2525

2626
export class Collection<DataType extends DefaultItem = DefaultItem> {
@@ -1181,9 +1181,7 @@ export class Collection<DataType extends DefaultItem = DefaultItem> {
11811181
* @public
11821182
* @param itemKeys - Item/s with identifier/s to be removed.
11831183
*/
1184-
public remove(
1185-
itemKeys: ItemKey | Array<ItemKey>
1186-
): {
1184+
public remove(itemKeys: ItemKey | Array<ItemKey>): {
11871185
fromGroups: (groups: Array<ItemKey> | ItemKey) => Collection<DataType>;
11881186
everywhere: (config?: RemoveItemsConfigInterface) => Collection<DataType>;
11891187
} {
@@ -1518,13 +1516,12 @@ export interface CreateCollectionConfigImpl<
15181516
initialData?: Array<DataType>;
15191517
}
15201518

1521-
export type CreateCollectionConfig<
1522-
DataType extends DefaultItem = DefaultItem
1523-
> =
1524-
| CreateCollectionConfigImpl<DataType>
1525-
| ((
1526-
collection: Collection<DataType>
1527-
) => CreateCollectionConfigImpl<DataType>);
1519+
export type CreateCollectionConfig<DataType extends DefaultItem = DefaultItem> =
1520+
1521+
| CreateCollectionConfigImpl<DataType>
1522+
| ((
1523+
collection: Collection<DataType>
1524+
) => CreateCollectionConfigImpl<DataType>);
15281525

15291526
export interface CollectionConfigInterface {
15301527
/**
@@ -1542,8 +1539,9 @@ export interface CollectionConfigInterface {
15421539
defaultGroupKey: ItemKey;
15431540
}
15441541

1545-
export interface CollectConfigInterface<DataType = any>
1546-
extends AssignDataConfigInterface {
1542+
export interface CollectConfigInterface<
1543+
DataType extends DefaultItem = DefaultItem
1544+
> extends AssignDataConfigInterface {
15471545
/**
15481546
* In which way the collected data should be added to the Collection.
15491547
* - 'push' = at the end

packages/core/src/collection/group/group.observer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Observer,
77
RuntimeJob,
88
} from '../../runtime';
9-
import { Group } from './index';
9+
import type { Group } from './index';
1010
import { DefaultItem } from '../collection';
1111
import { logCodeManager } from '../../logCodeManager';
1212

0 commit comments

Comments
 (0)