Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove context & job agent #2295

Merged
merged 11 commits into from
Dec 29, 2021
Merged

Conversation

futursolo
Copy link
Member

@futursolo futursolo commented Dec 23, 2021

Description

Fixes #2219
Closes #1080

This pull request remove Context and Job agent and replace them with examples in Context API.

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests (N/A)

@github-actions
Copy link

github-actions bot commented Dec 23, 2021

Visit the preview URL for this PR (updated for commit 06b2b55):

https://yew-rs--pr2295-remove-context-job-a-mgv273ou.web.app

(expires Sun, 02 Jan 2022 14:13:38 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@ranile
Copy link
Member

ranile commented Dec 23, 2021

We should rename the multi_thread example to either agents or workers. Since all major browsers support WASM Threads, I feel like the title of the example is misleading, considering it doesn't use threads. Pub sub example can also be renamed to contexts (or similar) to better describe what it represents.

Also, this seems like a good opportunity to use the new syntax introduced in #2292 in the examples which recently switched to function components.

@voidpumpkin voidpumpkin added the A-yew-agent Area: The yew-agent crate label Dec 23, 2021
examples/pub_sub/src/main.rs Outdated Show resolved Hide resolved
website/docs/concepts/html/events.mdx Outdated Show resolved Hide resolved
Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just need one change before it can merged.

website/docs/concepts/function-components/custom-hooks.mdx Outdated Show resolved Hide resolved
ranile
ranile previously approved these changes Dec 26, 2021
Cargo.toml Outdated
Comment on lines 22 to 28
"examples/agents",
"examples/nested_list",
"examples/node_refs",
"examples/password_strength",
"examples/portals",
"examples/pub_sub",
"examples/contexts",
"examples/router",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort this alphabetically so it's easier to find members based on the directory structure

Copy link
Member

@voidpumpkin voidpumpkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left minor not blocking comments

use msg_ctx::MessageProvider;

#[function_component]
pub fn Model() -> Html {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this App and keep it in a separate app.rs file, but up to you m8 :D

Comment on lines +20 to +21
#[function_component(ShowStorageChanged)]
pub fn show_storage_changed() -> Html {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[function_component(ShowStorageChanged)]
pub fn show_storage_changed() -> Html {
#[function_component]
pub fn ShowStorageChanged() -> Html {

Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@voidpumpkin, we can do renaming in the future.

@ranile ranile merged commit 7d52858 into yewstack:master Dec 29, 2021
@ranile ranile added this to the v0.20 milestone Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew-agent Area: The yew-agent crate breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bridged Context reach Agents can cause infinite cycle
4 participants