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

Leverage wasm-pack to handle wasm-bindgen installs & other awesomeness #5

Closed
thedodd opened this issue Aug 24, 2020 · 6 comments
Closed
Labels
cli Trunk CLI application discussion This item needs some discussion enhancement New feature or request help wanted Extra attention is needed

Comments

@thedodd
Copy link
Member

thedodd commented Aug 24, 2020

Per some discussion with @ashleygwilliams, there is a strong possibility that we will be able to leverage the excellent wasm-pack project to handle some other aspects of the build pipeline, and ensuring that certain dependencies are in place and matching correctly.

Take a look at:

May be able to just add wasm-pack to the trunk Cargo.toml and leverage the code that way. Time to test this out! Thanks Ashley for chatting about this and tossing ideas around!

@thedodd thedodd added enhancement New feature or request core labels Aug 24, 2020
@thedodd thedodd changed the title Install wasm-bindgen if not present on PATH Leverage wasm-pack to handle wasm-bindgen installs & other awesomeness Aug 25, 2020
@ashleygwilliams
Copy link

hey! i def think you can use wasm-pack to handle this- but as a libdep, wasm-pack will be huge (it was never really designed to be a lib, i just like shallow main arch for testing purposes, heh). i can break out a "wasm-pack-install" lib for you though, that will have all the functionality you need for installing wasm-bindgen, and maybe even wasm-opt? and other things. lemme know if you'e like me to do that!

@thedodd
Copy link
Member Author

thedodd commented Aug 28, 2020

Hey @ashleygwilliams that would be awesome!!! But definitely don't feel any pressure :) Let me know if there is anything you want me to tackle.

Also, does wasm-pack do anything special for the wasm-bindgen invocation/usage? Or is it relatively normal usage? I'll review the wasm-pack docs to check, but I figured I would ask you while you're here. I'm just trying to figure out the best location in the overall trunk build pipeline to invoke wasm-pack.

If my current paradigm is correct, then I'm thinking we will be able to just spawn off the wasm-pack installation/setup tasks for getting wasm-bindgen & wasm-opt in place. Then, after the cargo build phase of the pipeline is done, we will be able to do the final bindgen call & the opt calls and such.

Thoughts?

@MartinKavik
Copy link
Contributor

Just a note - we often use wasm-pack config in Cargo.toml - see seed-quickstart and docs. I assume we will need similar/same settings in trunk if it wouldn't use wasm-pack directly (?).

@thedodd
Copy link
Member Author

thedodd commented Aug 28, 2020

Sounds like a safe assumption to me.

@thedodd thedodd added cli Trunk CLI application discussion This item needs some discussion help wanted Extra attention is needed and removed core labels Sep 8, 2020
@thedodd
Copy link
Member Author

thedodd commented Sep 16, 2020

Hey @ashleygwilliams, I hope all is well. Just wanted to circle back on this one. I have a bit of time over the next few days to take a crack at this. Any specific areas of code which you think are most pertinent over in the wasm-pack code base? I'll make sure to do some exploration and such, but I figured I would ask you first :).

Also, if I get around to this, do you think I should open a PR in the wasm-pack repo to move the code over as a new workspace project in that repo? Just let me know. Cheers!

@thedodd
Copy link
Member Author

thedodd commented Jul 28, 2021

Not really applicable as @dnaka91 has implemented this for us in #146 (woot woot!)

@thedodd thedodd closed this as completed Jul 28, 2021
JonasAlaif pushed a commit to JonasAlaif/trunk that referenced this issue Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Trunk CLI application discussion This item needs some discussion enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants