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

Refactor and cleanup codebase #1842

Merged
merged 23 commits into from
Jul 18, 2021
Merged

Refactor and cleanup codebase #1842

merged 23 commits into from
Jul 18, 2021

Conversation

ranile
Copy link
Member

@ranile ranile commented May 6, 2021

Description

Fixes (part of) #1841
Fixes #885 (by removing the service altogether)

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests

@github-actions
Copy link

github-actions bot commented May 6, 2021

Visit the preview URL for this PR (updated for commit 574034d):

https://yew-rs--pr1842-refactor-52ya3hc1.web.app

(expires Sun, 25 Jul 2021 10:24:44 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@ranile ranile force-pushed the refactor branch 2 times, most recently from 4e0ba13 to 35c0428 Compare May 6, 2021 15:17
@ranile ranile marked this pull request as ready for review May 7, 2021 11:38
@ranile
Copy link
Member Author

ranile commented May 7, 2021

This PR is ready for review.

I have left out moving vdom into it's own crate out of this PR because it is pretty big as is and that would just make it bigger. When that happens, yew-validation will become a part of that crate. yew-router rewrite (#1791) and yew-agent rewrite will also help in the cleanup process.

@ranile ranile mentioned this pull request May 8, 2021
3 tasks
@ranile ranile force-pushed the refactor branch 2 times, most recently from 957d633 to 5d5e49c Compare May 17, 2021 16:32
This was referenced Jun 25, 2021
Copy link
Contributor

@mc1098 mc1098 left a comment

Choose a reason for hiding this comment

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

The function component macro tests seem to have been deleted and not moved to yew_macro.

The following example's READMEs have references to either yewtil or services:

  • General README for examples refers to the 'reader service' for the file_upload description
  • boids
  • crm
  • file_upload
  • futures
  • game_of_life
  • router
  • store
  • timer
  • todomvc

The Elements page under the Listeners heading has a code snippet that uses ConsoleService Elements.md L135

It would be nice to add a section about callback_future on the Callbacks doc page.

Is it worth removing the warning on the Function Components Introduction page as function components are being moved into the yew crate?

examples/file_upload/src/main.rs Outdated Show resolved Hide resolved
packages/yew-agent/src/link.rs Outdated Show resolved Hide resolved
packages/yew-agent/src/link.rs Outdated Show resolved Hide resolved
packages/yew/src/html/component/scope.rs Outdated Show resolved Hide resolved
packages/yew/src/html/component/scope.rs Outdated Show resolved Hide resolved
packages/yew/src/html/component/scope.rs Outdated Show resolved Hide resolved
@ranile
Copy link
Member Author

ranile commented Jul 18, 2021

The following example's READMEs have references to either yewtil or services:

The Elements page under the Listeners heading has a code snippet that uses ConsoleService Elements.md L135

Fixed those.

It would be nice to add a section about callback_future on the Callbacks doc page.

I think that can come later, this PR is already huge and mainly focuses on refactor.

Is it worth removing the warning on the Function Components Introduction page as function components are being moved into the yew crate?

Yes, removed it.

# Conflicts:
#	examples/todomvc/README.md
#	packages/yew-functional-macro/tests/function_attr/generic-props-fail.stderr
#	packages/yew-macro/tests/html_macro/block-fail.stderr
#	packages/yew-macro/tests/html_macro/iterable-fail.stderr
@ranile
Copy link
Member Author

ranile commented Jul 18, 2021

@mc1098 feel free to take a look again, I made the changes.

Copy link
Contributor

@mc1098 mc1098 left a comment

Choose a reason for hiding this comment

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

Couple of links to add to gloo references but that's it :D

examples/boids/README.md Outdated Show resolved Hide resolved
examples/file_upload/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mc1098 mc1098 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 to me :D

@mokeyish
Copy link

Hello everyone, what's the repleacement of https://yew.rs/concepts/services/fetch

@ranile
Copy link
Member Author

ranile commented Jul 24, 2021

Hello everyone, what's the repleacement of https://yew.rs/concepts/services/fetch

#1841 mentions them.

use serde_derive::{Deserialize, Serialize};
use yew::format::{Json, Nothing, Toml};
use yew::{html, Component, ComponentLink, Html, ShouldRender};
use yew_services::fetch::{FetchService, FetchTask, Request, Response};

Choose a reason for hiding this comment

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

Was the dashboard example mainly removed because it used FetchService? It caught my attention as being one of the only examples that included both server and client code.

Is there any similar example? Would it be worth rebuilding this one with updated services?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fetch isn't part of Yew anymore so I don't think there should be an example whose core functionality relies on an external library. I would like to add one in reqwasm though (ranile/reqwasm#11), which can be used to make fetch requests.

@voidpumpkin voidpumpkin added the A-yew Area: The main yew crate label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew Area: The main yew crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not using gloo for FileReader service
6 participants