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
58 commits
Select commit Hold shift + click to select a range
40f9293
Merge pull request #125 from agile-ts/master
bennobuilder Apr 13, 2021
ea9bb9f
created fake readme in core package
bennobuilder Apr 15, 2021
5bf8b48
optimized default Storage key positon by setting it into a config obj…
bennobuilder Apr 17, 2021
791398a
fixed storage tests
bennobuilder Apr 17, 2021
81c1476
fixed some tests
bennobuilder Apr 17, 2021
49233e7
fixed some tests
bennobuilder Apr 17, 2021
f294f0a
clarified loadValue naming
bennobuilder Apr 17, 2021
b2d64dd
optimized naming
bennobuilder Apr 18, 2021
1986e19
fixed tests
bennobuilder Apr 18, 2021
67fdf48
fixed typo
bennobuilder Apr 18, 2021
7b7faee
added default storageKey to persist methods and added custom Storage …
bennobuilder Apr 18, 2021
98417a6
fixed tests
bennobuilder Apr 18, 2021
2bc1dba
Merge pull request #127 from agile-ts/optimizeDefaultStorageKeyPosition
bennobuilder Apr 18, 2021
e745e89
fixed class component example
bennobuilder Apr 24, 2021
0a9c96c
optimized react readme
bennobuilder Apr 25, 2021
ceea207
created basic interval method
bennobuilder Apr 28, 2021
2b0877a
updated default ts config
bennobuilder Apr 28, 2021
569549b
undo generate single file
bennobuilder Apr 28, 2021
3457b20
Merge pull request #128 from agile-ts/put-package-in-single-file
bennobuilder Apr 28, 2021
47b884d
created basic interval tests
bennobuilder Apr 28, 2021
0f57a46
Merge pull request #129 from agile-ts/interval-feature
bennobuilder Apr 28, 2021
59f914d
changed lerna version
bennobuilder May 1, 2021
d1bbc1f
updated watch command
bennobuilder May 2, 2021
c7d9db0
added proxy core functionality, which only triggers rerender if used …
bennobuilder May 2, 2021
5cff0e4
created dummy useProxy hook
bennobuilder May 3, 2021
df4961d
added object deepness check
bennobuilder May 3, 2021
afb0905
added proxytree package
bennobuilder May 3, 2021
6985118
tried to create proxy tree
bennobuilder May 3, 2021
6b7e78d
optimized proxy-tree
bennobuilder May 4, 2021
e10aba8
added first proxy tree test
bennobuilder May 4, 2021
84793eb
made proxy tree working
bennobuilder May 4, 2021
2c903c1
implemented proxy tree into proxy hook
bennobuilder May 4, 2021
28803dc
refactored proxy tree
bennobuilder May 4, 2021
4736016
created basic proxytree tests
bennobuilder May 5, 2021
a970e25
outsourced recordUsage
bennobuilder May 5, 2021
5944268
fixed useProxy doesn't work with array
bennobuilder May 5, 2021
b5eb184
fixed broken tests
bennobuilder May 5, 2021
99c4c9b
expanded runtime tests
bennobuilder May 5, 2021
8b56b15
expanded runtime tests
bennobuilder May 6, 2021
15e7a01
expanded runtime tests
bennobuilder May 6, 2021
f6ff264
update example
bennobuilder May 6, 2021
f395eb0
fixed tests
bennobuilder May 6, 2021
b0cdd98
Merge remote-tracking branch 'origin/proxy-hook' into proxy-hook
bennobuilder May 6, 2021
71f9dc1
optimized readme
bennobuilder May 6, 2021
896d8c0
expanded tests
bennobuilder May 6, 2021
738d109
fixed typos
bennobuilder May 7, 2021
4066fa0
fixed multiple same paths in route array issue
bennobuilder May 7, 2021
2d8ae1c
fixed typos
bennobuilder May 7, 2021
c52e734
now proxy tree doesn't track 'method' properties like object.toString…
bennobuilder May 8, 2021
aa38ef0
Merge pull request #131 from agile-ts/proxy-hook
bennobuilder May 8, 2021
bdf5dbb
added function option to set method (resole #132)
bennobuilder May 8, 2021
7541370
outsourced utils and logger
bennobuilder May 8, 2021
510fade
fixed broken imports in core
bennobuilder May 8, 2021
433273b
fixed tests
bennobuilder May 8, 2021
cbded73
fixed typos
bennobuilder May 8, 2021
510b659
fixed typos
bennobuilder May 8, 2021
5355283
Merge pull request #135 from agile-ts/outsource-logger-and-utils
bennobuilder May 8, 2021
616681d
bumped version
bennobuilder May 8, 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
16 changes: 16 additions & 0 deletions .changeset/shy-jars-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@agile-ts/api': patch
'@agile-ts/core': patch
'@agile-ts/event': patch
'@agile-ts/logger': patch
'@agile-ts/multieditor': patch
'@agile-ts/proxytree': patch
'@agile-ts/react': patch
'@agile-ts/utils': patch
'@agile-ts/vue': patch
---

- Outsourced Logger and Utils from the `core` package.
- Created Proxy Tree
- Added `useProxy` Hook to `react` package
- Updated `core` to work with Proxy KeyMap
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/header_background.png" alt="AgileTs">
> Global, simple, spacy State and Logic Framework

> Global, simple, spacy State and Logic Framework

<br />

<p align="left">
<a href="https://github.com/agile-ts/agile">
<img src="https://img.shields.io/github/license/agile-ts/agile.svg?label=license&style=flat&colorA=293140&colorB=4a4872" alt="GitHub License"/>
Expand Down Expand Up @@ -76,8 +76,8 @@ More examples can be found in the [Example Section](https://agile-ts.org/docs/ex
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/why_should_i_use_agile.png" alt="Why should I use AgileTs?"/>

AgileTs is a global, simple, well-tested State Management Framework implemented in Typescript.
It offers a reimagined API that focus on **developer experience** and allows you to **quickly** and **easily** manage your States.
Besides States, AgileTs offers some other powerful apis that make your life easier.
It offers a reimagined API that focuses on **developer experience** and allows you to **quickly** and **easily** manage your States.
Besides States, AgileTs offers some other powerful APIs that make your life easier.
The philosophy behind AgileTs is simple:

### 🚅 Straightforward
Expand Down Expand Up @@ -116,8 +116,8 @@ Write minimalistic, boilerplate-free code that captures your intent.

### ⛳️ Centralize

AgileTs is designed to take all business logic out of UI-Components and put them in a central place often called `core`.
The benefit of keeping logic separate to UI-Components is to make your code more decoupled, portable and above all easily testable.
AgileTs is designed to take all business logic out of UI-Components and put them in a central place, often called `core`.
The benefit of keeping logic separate to UI-Components is to make your code more decoupled, portable, and above all, easily testable.

### 🎯 Easy to Use

Expand All @@ -132,19 +132,19 @@ you can jump straight into our [Example](https://agile-ts.org/docs/examples/Intr
<br />
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/installation_header.png" alt="Installation"/>

To properly use AgileTs, in a UI-Framework we need to install **two** packages.
To properly use AgileTs, in a UI-Framework, we need to install **two** packages.

- The _Core Package_, which acts as the brain of AgileTs and manages all your States
```
npm install @agile-ts/core
```

- and a _fitting Integration_ for your preferd UI-Framework. In my case the [React Integration](https://www.npmjs.com/package/@agile-ts/react).
- and a _fitting Integration_ for your preferred UI-Framework. In my case, the [React Integration](https://www.npmjs.com/package/@agile-ts/react).
Check [here](https://agile-ts.org/docs/frameworks) if your desired Framework is supported, too.
```
npm install @agile-ts/react
```


<br />

Expand All @@ -154,8 +154,8 @@ To properly use AgileTs, in a UI-Framework we need to install **two** packages.

Sounds AgileTs interesting to you?
Checkout our **[documentation](https://agile-ts.org/docs/introduction)**, to learn more.
And I promise you, you will be able to use AgileTs in no time.
In case you have any further questions don't hesitate joining our [Community Discord](https://discord.gg/T9GzreAwPH).
And I promise you. You will be able to use AgileTs in no time.
In case you have any further questions, don't hesitate to join our [Community Discord](https://discord.gg/T9GzreAwPH).


<br />
Expand All @@ -164,8 +164,8 @@ In case you have any further questions don't hesitate joining our [Community Dis
<br />
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/contribute_header.png" alt="Contribute"/>

Get a part of AgileTs and start contributing. We welcome any meaningful contribution 😀
To find out more checkout the [CONTRIBUTING.md](https://github.com/agile-ts/agile/blob/master/CONTRIBUTING.md).
Get a part of AgileTs and start contributing. We welcome any meaningful contribution. 😀
To find out more, check out the [CONTRIBUTING.md](https://github.com/agile-ts/agile/blob/master/CONTRIBUTING.md).

<a href="https://codeclimate.com/github/agile-ts/agile/coverage.svg">
<img src="https://codeclimate.com/github/agile-ts/agile/badges/gpa.svg" alt="Maintainability"/>
Expand Down Expand Up @@ -193,5 +193,4 @@ To find out more checkout the [CONTRIBUTING.md](https://github.com/agile-ts/agil
<br />
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/credits_header.png" alt="Credits"/>

AgileTs is inspired by [MVVM Frameworks](https://de.wikipedia.org/wiki/Model_View_ViewModel) like [MobX](https://mobx.js.org/README.html) and [PulseJs](https://github.com/pulse-framework/pulse).

AgileTs is inspired by [MVVM Frameworks](https://de.wikipedia.org/wiki/Model_View_ViewModel) like [MobX](https://mobx.js.org/README.html) and [PulseJs](https://github.com/pulse-framework/pulse).
1 change: 1 addition & 0 deletions examples/react/class-component-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@agile-ts/api": "file:.yalc/@agile-ts/api",
"@agile-ts/core": "file:.yalc/@agile-ts/core",
"@agile-ts/event": "file:.yalc/@agile-ts/event",
"@agile-ts/multieditor": "file:.yalc/@agile-ts/multieditor",
"@agile-ts/react": "file:.yalc/@agile-ts/react",
"react": "^16.13.1",
Expand Down
4 changes: 3 additions & 1 deletion examples/react/class-component-ts/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Agile, clone, Logger } from '@agile-ts/core';
import { Event } from '@agile-ts/event';

export const App = new Agile({
logConfig: { level: Logger.level.DEBUG, timestamp: true },
waitForMount: false,
});

export const MY_STATE = App.createState<string>('MyState'); //.persist();
Expand Down Expand Up @@ -46,7 +48,7 @@ MY_COLLECTION.getGroup('myGroup')?.persist({

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

export const MY_EVENT = App.createEvent<{ name: string }>({
export const MY_EVENT = new Event<{ name: string }>(App, {
delay: 3000,
key: 'myEvent',
});
Expand Down
1 change: 1 addition & 0 deletions examples/react/functional-component-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@agile-ts/multieditor": "file:.yalc/@agile-ts/multieditor",
"@agile-ts/react": "file:.yalc/@agile-ts/react",
"@agile-ts/event": "file:.yalc/@agile-ts/event",
"@agile-ts/proxytree": "file:.yalc/@agile-ts/proxytree",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
Expand Down
53 changes: 49 additions & 4 deletions examples/react/functional-component-ts/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import React, { useEffect } from 'react';
import './App.css';
import { useAgile, useWatcher } from '@agile-ts/react';
import { useAgile, useWatcher, useProxy } from '@agile-ts/react';
import { useEvent } from '@agile-ts/event';
import {
COUNTUP,
MY_COLLECTION,
MY_COMPUTED,
MY_EVENT,
MY_STATE,
MY_STATE_2,
MY_STATE_3,
STATE_OBJECT,
} from './core';
import { globalBind } from '@agile-ts/core';
import { generateId, globalBind } from '@agile-ts/core';

let rerenderCount = 0;
let rerenderCountInCountupView = 0;

const App = (props: any) => {
// Note: Rerenders twice because of React Strickt Mode (also useState does trigger a rerender twice)
Expand All @@ -31,14 +34,23 @@ const App = (props: any) => {
] = useAgile([
MY_STATE,
MY_STATE_2,
MY_COLLECTION.getItem('1'),
MY_COLLECTION.getItem('id1'),
MY_COLLECTION.getSelector('mySelector'),
MY_STATE_3,
undefined,
MY_COLLECTION,
]);
const [myGroup] = useAgile([MY_COLLECTION.getGroupWithReference('myGroup')]);

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

console.log('Item1: ', item2?.name);
console.log('Collection: ', collection2.slice(0, 2));

// const myCollection2 = useAgile(MY_COLLECTION);

const mySelector = useAgile(MY_COLLECTION.getSelector('mySelector'));
Expand All @@ -56,6 +68,19 @@ const App = (props: any) => {
globalBind('__core__', { ...require('./core') });
}, []);

const CountupView = () => {
const countup = useAgile(COUNTUP);
rerenderCountInCountupView++;
return (
<div style={{ backgroundColor: 'white', padding: 10 }}>
<p style={{ color: 'black' }}>Countup: {countup}</p>
<p style={{ color: 'black' }}>
Rerender Count of count up View: {rerenderCountInCountupView}
</p>
</div>
);
};

return (
<div className="App">
<header className="App-header">
Expand All @@ -78,6 +103,25 @@ const App = (props: any) => {
<p>{myComputed}</p>
</div>

<div className={'Container'}>
<h3 className={'Title'}>My State Object</h3>
<p>
Deep Name: {stateObject.friends.hans.name} {stateObject.location}
</p>
<button
onClick={() => {
STATE_OBJECT.patch({ friends: { hans: { name: generateId() } } });
}}>
Change deep name
</button>
<button
onClick={() => {
STATE_OBJECT.patch({ name: generateId() });
}}>
Change shallow name
</button>
</div>

<div className={'Container'}>
<h3 className={'Title'}>My Event</h3>
<button onClick={() => MY_EVENT.trigger({ name: 'test' })}>
Expand Down Expand Up @@ -124,7 +168,8 @@ const App = (props: any) => {
}>
Update mySelector value
</button>
<p>{rerenderCount}</p>
<p>Rerender Count: {rerenderCount}</p>
<CountupView />
</header>
</div>
);
Expand Down
Loading