-
Notifications
You must be signed in to change notification settings - Fork 84
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
Migrate to web-sys #32
Conversation
This pull request is automatically deployed with Now. |
Sorry, why is this merged? I think there's a compile error on master if I do |
mmmmm it was working locally for me my bad!! taking a look |
@qm3ster what error are you seeing? I don't see anything. Hmm.. |
I ran cargo update and now my I'll fix the |
Currently on
This is On Does it really work for you? |
Yeah I can build/run the isomorphic app just fine on I get the same error as you when I try to run the I'm using I'll open an issue in the wasm-bindgen repo |
Opened an issue here -> rustwasm/wasm-bindgen#857 |
@qm3ster As explained in that issue it's because we're depending on |
Maybe we should install that binary locally into the project? |
|
I'm on |
Do you use Discord? |
Haha I don't - should I be? |
Just don't know where to talk more synchronously. |
Ahh word -> I'm not sure what the best platforms are for chatting around open source projects but if ya wanna make one for Blehhhhhhh yeah all of this should be less of a mess once But in the meantime: Did ya run |
Yeah, just changing it to build without This makes the container build and run locally successfully for me. The wasm payload is 5x bigger though :( Do you maybe wanna make a repo where travis would be publishing this to your DockerHub? FROM yasuyuky/rust-nightly-musl:latest as build
# Install wasm32-unknown-unknown-target
RUN rustup default nightly
RUN rustup target add wasm32-unknown-unknown \
x86_64-unknown-linux-musl
# Node.js & npm
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
RUN curl -sL https://github.com/WebAssembly/binaryen/releases/download/version_51/binaryen-version_51-x86-linux.tar.gz\
| tar -xzf - binaryen-version_51/wasm-opt --strip-components=1 &&\
chmod +x ./wasm-opt &&\
mv ./wasm-opt /usr/local/bin/
# Install WASM bindgen CLI
# RUN curl -OL https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.21/wasm-bindgen-0.2.21-x86_64-unknown-linux-musl.tar.gz &&\
# tar xf wasm-bindgen-0.2.21-x86_64-unknown-linux-musl.tar.gz &&\
# rm wasm-bindgen-0.2.21-x86_64-unknown-linux-musl.tar.gz &&\
# chmod +x wasm-bindgen-0.2.21-x86_64-unknown-linux-musl/wasm-bindgen &&\
# mv wasm-bindgen-0.2.21-x86_64-unknown-linux-musl/wasm-bindgen /usr/local/bin/wasm-bindgen
# TODO: revert this when `web-sys` is released to avoid compiling
RUN cargo install wasm-bindgen-cli --git https://github.com/rustwasm/wasm-bindgen
WORKDIR /usr/src This could be used to speed up |
Oh nice idea on having a base image with our deps Would you like to own that? Maybe qm3ster/percy-dockerfile or something? Or are you saying that it’s easier if I do it? Don’t mind either way! |
Idk what the naming convention is. Locally I named it services:
- docker
before_install:
- docker build -t LMAO_WHAT_ARE_TAGS_WHAT_GOES_HERE .
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push chinedufn/percy-builder But idk about travis specifics. Eg, why they suggest And you also need to do travis env set DOCKER_USERNAME myusername
travis env set DOCKER_PASSWORD secretsecret |
@qm3ster so WRT things being broken it looks like they're planning on publishing |
What
This PR migrates
virtual-dom-rs
to use web-sys and deletes thepercy-webapis
crate.Why
This was always the plan, we were just waiting for
web-sys
to mature.This PR makes it easier for people to use
web-sys
alongside Percy. And just generally means that we've staying in line with the wasm-bindgen project.Highlights
We were previously being a bit hacky and turning things into
HtmlElement
s that really aren't elements.web-sys
enforces things only being able to be type casted in ways that are actually specified inweb-idl
, so we had to refactor some of our virtual dom code a bit. No major overhauls, just being a bit more correct in a few placesAdded some new browser tests to our
jsdom
test suite. ATODO
is to deprecate this suite in favor of using wasm-bindgen-test in chrome and firefoxAdded some documentation on how we handle text nodes
Overall there isn't any new functionality here.. Just some re-jigging to use the real types that we're supposed to use instead of making things that aren't
HtmlElement
intoHtmlElement
like we were before.Closes #24