-
Notifications
You must be signed in to change notification settings - Fork 384
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
Fix web viewer feature flags #8295
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
Latest documentation preview deployed successfully.
Note: This comment is updated whenever you push a commit. |
rerun_js/web-viewer/build-wasm.mjs
Outdated
@@ -31,7 +31,8 @@ function buildWebViewer(mode) { | |||
"cargo run -p re_dev_tools -- build-web-viewer", | |||
modeFlags, | |||
"--target no-modules-base", | |||
"--features grpc", | |||
"--no-default-features", | |||
"--features grpc,map_view", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we have a release = ["grpc", "map_view"]
feature in re_viewer
instead. It feels like a more discoverable location for controlling what goes into the release.
"--features grpc,map_view", | |
"--features release", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I just made map_view
a default feature. I don't agree with the release
feature for web viewer specifically, it makes sense for rerun-cli because there it makes it possible for it to be compiled without nasm
, and with -F release
in case you do want nasm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The big problem here imho was build_web_viewer
silently passing --no-default-features
to the re_viewer
build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Btw, I wonder if we shouldn't make a re_web_viewer
crate that just wraps re_viewer
. re_viewer
is weird in that it is both a library, and web app. Food for thought
@@ -31,7 +31,8 @@ function buildWebViewer(mode) { | |||
"cargo run -p re_dev_tools -- build-web-viewer", | |||
modeFlags, | |||
"--target no-modules-base", | |||
"--features grpc", | |||
"--no-default-features", | |||
"--features grpc,map_view", // no `analytics` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for the NPM package, we don't want users' applications which embed the web viewer this way to send analytics to us. they will only do that if they embed the web viewer as an iframe
rerun-build-web = "rustup target add wasm32-unknown-unknown && cargo run -p re_dev_tools -- build-web-viewer --no-default-features --features analytics,grpc,map_view --debug" | ||
|
||
# Compile the web-viewer wasm and the cli. | ||
# | ||
# This installs the `wasm32-unknown-unknown` rust target if it's not already installed. | ||
# (this looks heavy but takes typically below 0.1s!) | ||
rerun-build-web-cli = "rustup target add wasm32-unknown-unknown && cargo run -p re_dev_tools -- build-web-viewer --features analytics,grpc --debug && cargo build --package rerun-cli --no-default-features --features web_viewer" | ||
rerun-build-web-cli = "rustup target add wasm32-unknown-unknown && cargo run -p re_dev_tools -- build-web-viewer --no-default-features --features analytics,grpc,map_view --debug && cargo build --package rerun-cli --no-default-features --features web_viewer" | ||
|
||
# Compile and run the web-viewer in release mode via rerun-cli. | ||
# | ||
# You can also give an argument for what to view (e.g. an .rrd file). | ||
# | ||
# This installs the `wasm32-unknown-unknown` rust target if it's not already installed. | ||
# (this looks heavy but takes typically below 0.1s!) | ||
rerun-web-release = { cmd = "cargo run --package rerun-cli --no-default-features --features web_viewer --release -- --web-viewer", depends_on = [ | ||
rerun-web-release = { cmd = "cargo run --package rerun-cli --no-default-features --features web_viewer,map_view,grpc --release -- --web-viewer", depends_on = [ | ||
"rerun-build-web-release", | ||
] } | ||
|
||
# Compile the web-viewer wasm in release mode. | ||
# | ||
# This installs the `wasm32-unknown-unknown` rust target if it's not already installed. | ||
# (this looks heavy but takes typically below 0.1s!) | ||
rerun-build-web-release = "rustup target add wasm32-unknown-unknown && cargo run -p re_dev_tools -- build-web-viewer --features analytics,grpc --release -g" | ||
rerun-build-web-release = "rustup target add wasm32-unknown-unknown && cargo run -p re_dev_tools -- build-web-viewer --no-default-features --features analytics,grpc,map_view --release -g" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't easier to keep the default features and just add on grpc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to be more explicit here, because you're not going to type the long command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Btw, I wonder if we shouldn't make a re_web_viewer
crate that just wraps re_viewer
. re_viewer
is weird in that it is both a library, and web app. Food for thought
|
Related
map-view
feature not enabled in web-viewer #8294What
build-web-viewer
now propagates--no-default-features
, and doesn't include it by defaultmap_view
a default feature inre_viewer