-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
272: Multi-threading, concurrency, agents r=DenisKolodin a=DenisKolodin This is a series of bold experiments and I really love 💓 this PR. It makes this framework a **multi-threaded** (it's not a joke) and brings actors model everywhere. Now your yew frontend-apps will be more _Erlang_ or _Actix_ apps like 🚀 Also, I've removed a context. Completely! Components simplified. Now it's an actor which you could connect to and interact with messages. Other benefit is your components could interact each other #270 Since this PR will be merged the framework turned into multi-threaded concurrency-friendly frontend framework. Sorry me for buzzwords overload ) It still need Routing #187 and fixes of the most issues. I'll get to that. But extra benefit of this PR: it fixes major emscripten issues #220 Remaining: - [x] Add CHANGELOG.md - [x] Update README.md - [x] Create issue: Send `Connected` notification for `Private` agents (#282) - [x] Create issue: Send `Connected` notification for `Public` agents (#282) - [x] Create issue: Implement `Global` kind of agents (based on `SharedWorker`) (#283) - [x] Create issue: Add components interaction example (#284) Co-authored-by: Denis Kolodin <deniskolodin@gmail.com>
- Loading branch information
Showing
62 changed files
with
1,808 additions
and
1,060 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Changelog | ||
|
||
## 0.5 - unreleased | ||
|
||
### Breaking changes | ||
|
||
- Context requirement removed. Not necessary to use `Component<CTX>` type parameter. | ||
Instead of a context a link to an environment provided with `Component::create` call. | ||
All examples had changed. | ||
|
||
- `html!` macro adds `move` modifier and the type of event for every handler (#240). Use | ||
`<input oninput=|e| Msg::UpdateEvent(e.value), />` instead of obsolete | ||
`<input oninput=move |e: InputData| Msg::UpdateEvent(e.value), />`. | ||
|
||
### New features | ||
|
||
- Added `Agent`s concept. Agents are separate activities which you could run in the same thread | ||
or in a separate thread. There is `Context` kind of agent that spawn context entities as many | ||
as you want and you have to interact with a context by a messages. To join an agent use | ||
`Worker::bridge` method and pass a link of component's environment to it. | ||
|
||
- Added three types of agents: `Context` - spawns once per thread, `Job` - spawns for every bridge, | ||
`Public` - spawns an agent in a separate thread (it uses [Web Workers API] under the hood). | ||
|
||
- Added `<Component: with props />` rule to set a whole struct as a properties of a component. | ||
|
||
- All services reexported in `yew::services` moudle. | ||
|
||
[Web Workers API]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | ||
|
||
### Bug fixes | ||
|
||
- Bug with emscripten target `RuntimeError: index out of bounds` (#220) fixed with a new scheduler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.