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
Support feature flags via CLI close #60 #183
Support feature flags via CLI close #60 #183
Conversation
I'll update the CHANGELOG and the README after the code-changes are approved. Once that's done I'll squash my commits. |
@thedodd What do you mean by the following?
see #60 (comment) |
I converted this back to a draft to work on the conflicts in the files
Btw, @thedodd, what do you mean with
As in, what would |
fb2f022
to
0dd4414
Compare
Hey! Is there any update on this?I'd love to use this feature, so I can reduce my wasm binary size (using build-std). |
I'll try to get this PR up-to-date with |
I'm waiting for a quick go-ahead, then I'll get to the checklist of
I want to know if the way I implemented this makes sense for the project. |
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.
One small item. We should be g2g after that.
BTW, the -Z
bit that I was referring to is in reference to Cargo's -Z
, which passes options directly to rustc. Let's not tackle that in this PR.
src/config/models.rs
Outdated
#[clap(long)] | ||
#[serde(default)] | ||
pub all_features: bool, | ||
/// The public URL from which assets are to be served [default: /] |
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.
Looks like the docstring needs to be updated here.
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 the new docstring:
/// A comma-separated list of features to activate, must not be used with all_features [default: ""]
#[clap(long)]
pub features: Option<String>,
The new output for trunk build -h
:
trunk-build
Build the Rust WASM app and all of its assets
USAGE:
trunk build [OPTIONS] [TARGET]
ARGS:
<TARGET> The index HTML file to drive the bundling process [default: index.html]
OPTIONS:
--all-features Build with all features [default: false]
-d, --dist <DIST> The output dir for all final assets [default: dist]
--features <FEATURES> A comma-separated list of features to activate, must not be
used with all-features [default: ""]
--filehash <FILEHASH> Whether to include hash values in the output file names
[default: true]
-h, --help Print help information
--no-default-features Build without default features [default: false]
--public-url <PUBLIC_URL> The public URL from which assets are to be served [default: /]
--release Build in release mode [default: false]
Let me know if this works for you/the team;
I'll get to writing the changelog & readme stuff in the meantime.
I just pushed changes to Two things:
|
a84451c
to
744bad5
Compare
I've just squashed the commits on my branch I now consider this ready-to-merge; awaiting feedback. |
Friendly reminder for @thedodd This is ready-to-merge see #183 (comment) 🚀:
Please let me know if you'd like me to make further changes. |
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.
Woot woot! Thanks for all of the hard work and patience on this @Bernd-L!
Checklist
This PR extends #166 to add
data-cargo-all-features
anddata-cargo-no-default-features
as well as CLI options for these build-config options.NoticeThis is (obviously) a work-in-progress.I'll be using (and modifying) the work done in #166 and introduce--all-features
and--no-default-features
.In a future PR, I may even add support for that via a<link data-trunk>
tag (extending #166 to "all" and "no-default").