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

Provide a first-class tool to build yew projects #1671

Closed
1 of 3 tasks
jkelleyrtp opened this issue Dec 23, 2020 · 4 comments
Closed
1 of 3 tasks

Provide a first-class tool to build yew projects #1671

jkelleyrtp opened this issue Dec 23, 2020 · 4 comments
Labels
feature-request A feature request

Comments

@jkelleyrtp
Copy link
Contributor

I've been working on my own local development tool, yew-pack for the past month or so.

https://github.com/jkelleyrtp/yew-projects/tree/master/packages/yew-pack

Our current lineup of examples are great, but for a newbie, a bit convoluted to get up and running. We should provide (or endorse!) a first-class tool to develop yew projects. Trunk and wasm-run are also great tools. Ultimately, it should be as simple as yewpack build/bundle/publish/develop/test without having to pull in the whole wasm_bindgen ecosystem. It would also greatly simplify our examples folder and give some sanity to folder structure/layout without having to dance around the lib/main requirements that wasm-pack/wasm_bindgen forces on wasm projects.

I'd happily revamp the docs, examples, and add a project or endorse a project like trunk so it's easier for newbies to get started with Yew.

Questionnaire

  • I'm interested in implementing this myself but don't know where to start
  • I would like to add this feature
  • I don't have time to add this right now, but maybe later
@jkelleyrtp jkelleyrtp added the feature-request A feature request label Dec 23, 2020
@ranile
Copy link
Member

ranile commented Dec 24, 2020

I think where we stand today with today with trunk is good enough that doing anything more would cause more harm than good. There was this discussion about Yew CLI tool.

Ultimately, it should be as simple as yewpack build/bundle/publish/develop/test

yewpack build = trunk build
yewpack develop = trunk serve/watch
yewpack test = trunk test (trunk-rs/trunk#20)

I'm not sure how build, bundle and publish are any different. Something similar to ng deploy doesn't really make sense here since the static files can just be deployed manually.

without having to pull in the whole wasm_bindgen ecosystem

wasm_bindgen ecosystem (specifically wasm-bindgen-cli) would be needed to output wasm binaries in the similar way to how tsc is needed to generate javascript code. Although I do agree that it should be abstracted. Even trunk's readme states:

Next, we will need to install wasm-bindgen-cli. In the future Trunk will handle this for you.

I wouldn't mind if trunk installs wasm-bindgen-cli for me on first run or bundles it. trunk-rs/trunk#5 is also relevant here.

add a project or endorse a project like trunk so it's easier for newbies to get started with Yew.

That's where #1384 comes in. There already is good documentation for using Yew with trunk so a tutorial (like the one by Angular, React, Kotlin/React hands on) would help a lot.


When it comes to tooling, I've found that the biggest thing Yew lacks is good editor/IDE support. But I highly doubt that's something we can fix now

@jkelleyrtp
Copy link
Contributor Author

I think where we stand today with today with trunk is good enough that doing anything more would cause more harm than good. There was this discussion about Yew CLI tool.

I like trunk, but never heard of it until recently. I think Trunk would take off more if the docs, examples, and guides here in the Yew repository selected it as the unofficial (or official!) tool of choice for building, developing, and testing yew apps.

Ultimately, it should be as simple as yewpack build/bundle/publish/develop/test

yewpack build = trunk build
yewpack develop = trunk serve/watch
yewpack test = trunk test (thedodd/trunk#20)

I'm not sure how build, bundle and publish are any different. Something similar to ng deploy doesn't really make sense here since the static files can just be deployed manually.

Uh, yeah, I guess they all sound cool but do the same thing.

without having to pull in the whole wasm_bindgen ecosystem

wasm_bindgen ecosystem (specifically wasm-bindgen-cli) would be needed to output wasm binaries in the similar way to how tsc is needed to generate javascript code. Although I do agree that it should be abstracted. Even trunk's readme states:

Next, we will need to install wasm-bindgen-cli. In the future Trunk will handle this for you.

I wouldn't mind if trunk installs wasm-bindgen-cli for me on first run or bundles it. thedodd/trunk#5 is also relevant here.

In writing yew-pack (which is honestly just a stripped down version of Trunk, because I never saw trunk 🙃) you don't actually need the CLI installed. There's a support crate which backs the CLI that you can use directly. In terms of ergonomics, Yew would be more attractive for newbies if it was as simple as installing a single tool. But, that's an issue for Trunk rather than Yew.

add a project or endorse a project like trunk so it's easier for newbies to get started with Yew.

That's where #1384 comes in. There already is good documentation for using Yew with trunk so a tutorial (like the one by Angular, React, Kotlin/React hands on) would help a lot.

When it comes to tooling, I've found that the biggest thing Yew lacks is good editor/IDE support. But I highly doubt that's something we can fix now

I commented on #1384 a while ago and spun up my own documentation, we haven't seen too much movement yet. There was an article on HN that got popular, but one of the biggest criticisms was how convoluted the build system was. Hackernews loves to complain, but it did seem obvious that Yew hasn't focused on that area of tooling yet and made the ecosystem feel immature. The point being that tooling is just as important as the project itself.

I'd love to contribute to IDE support, dev extensions, and the like to make writing Yew that much better.

@ranile
Copy link
Member

ranile commented Dec 24, 2020

I think Trunk would take off more if the docs, examples, and guides here in the Yew repository selected it as the unofficial (or official!) tool of choice for building, developing, and testing yew apps.

It does here. "Build a sample app" portion of the docs also uses trunk.

I'd love to contribute to IDE support, dev extensions, and the like to make writing Yew that much better.

I think taking a look at intellij-rust/intellij-rust#6367 or proc-macro support (intellij-rust/intellij-rust#1786) would be a starting point, for support in IntelliJ.

@jkelleyrtp
Copy link
Contributor Author

I think Trunk would take off more if the docs, examples, and guides here in the Yew repository selected it as the unofficial (or official!) tool of choice for building, developing, and testing yew apps.

It does here. "Build a sample app" portion of the docs also uses trunk.

I'd love to contribute to IDE support, dev extensions, and the like to make writing Yew that much better.

I think taking a look at intellij-rust/intellij-rust#6367 or proc-macro support (intellij-rust/intellij-rust#1786) would be a starting point, for support in IntelliJ.

Pfffft, I never saw #1559 - glad it happened! Though, each example is a subcrate in the top-level Cargo.toml. I imagine trunk can work with just examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature request
Projects
None yet
Development

No branches or pull requests

2 participants