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

How do you manage stdweb? #8

Closed
genderev opened this issue Feb 20, 2021 · 1 comment
Closed

How do you manage stdweb? #8

genderev opened this issue Feb 20, 2021 · 1 comment

Comments

@genderev
Copy link

Hi! I noticed that you built your (quite nice looking) personal site with stdweb. I can see that stdweb is a dependency in your Cargo.toml, I'm just reluctant to use stdweb because the examples do not run. Does the crate still function overall?

I've been having trouble with stdweb and I would like to be able to use it. How do you use it? Do you not get the errors that I have been getting?

@rickycodes
Copy link
Owner

rickycodes commented Feb 21, 2021

@genderev

hiya! thanks for the compliment. stdweb hasn't been maintained in a while and i think you may be right in that it's not working with the more recent nightly toolchains

i actually first built this website back in 2018. if you're looking to start a new rust -> wasm project there might be better alternatives for you.

that said i was able to get the project working (with a not broken wasm) locally just now by switching around my rust toolchain using rustup:

# install an old toolchain
rustup toolchain install nightly-2019-08-01

# set the old toolchain as default:
rustup default nightly-2019-08-01

after doing that I was able to build the site fine using the ./build.sh file:

$ ./build.sh 
Generate + minify HTML...
npx: installed 12 in 1.347s
HTML deployed to static/index.html
Building...
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
    Processing "rickycodes.wasm"...
    Finished processing of "rickycodes.wasm"!
The `rickycodes` was deployed to "/home/ricky/projects/www/target/deploy"!
Minify...
JavaScript deployed to target/deploy/*.js
Done.

The http server also still seems to be working:

$ ./build.sh --serve
Starting up local server...
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
    Processing "rickycodes.wasm"...
    Finished processing of "rickycodes.wasm"!

If you need to serve any extra files put them in the 'static' directory
in the root of your crate; they will be served alongside your application.
You can also put a 'static' directory in your 'src' directory.

Your application is being served at '/rickycodes.js'. It will be automatically
rebuilt if you make any changes in your code.

You can access the web server at `http://127.0.0.1:8000`.

using an older toolchain will also work for the examples (i would imagine)

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

No branches or pull requests

2 participants