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

Significant CLI improvements #160

Merged
merged 19 commits into from
Jul 18, 2022
Merged

Significant CLI improvements #160

merged 19 commits into from
Jul 18, 2022

Conversation

arctic-hen7
Copy link
Member

This PR makes the Perseus CLI much more user-friendly, and significantly more powerful, improving overall performance and usability.

  • Switches from wasm-pack to wasm-bindgen for greater flexibility
  • Eliminates dual library/binary structure (Perseus apps are now one binary)
    • (Therefore removes Cargo.toml bloat)
  • Automatically installs wasm-bindgen and wasm-opt into dist/ to prevent the user having to manage dependencies (but allows user override)
  • Automatically installs wasm32-unknown-unknown target if rustup is available
  • Automatically installs Cranelift backend for massivley improved compile-time performance in development
  • Adds system-wide cache for external tools to prevent unnecessary network requests
  • Moves environment variables used to configure CLI into flags available on every command

After this PR, users will need only one dependency on their systems to run Perseus: Rust itself. If they installed with rustup, everything will be automatic and speedy out-of-the-box, with full capacity for user overrides. Also, this PR achieves ~50kb bundle size reductions by switching to wasm-bindgen and wasm-opt directly.

Note: the Cranelift backend is experimental, and might be disabled by default, I haven't decided yet. (It does cut compile times by 75% though.)

…her than `wasm-pack`

This provides *significant* flexibility for all sorts of brilliant new features!

BREAKING CHANGE: `[lib]`/`[[bin]]` settings no longer required in
`Cargo.toml`, and `lib.rs` should be renamed to `main.rs` (everything is
a binary now)
This cleans things up a little, and makes directory structures and
cleaning build artifacts much simpler.
…ocally

Perseus now has no dependencies except Rust! This also *dramatically*
reduces bundle sizes for some reason (`wasm-pack` overhead?), by over
50kb in the basic example.
Since we now store `cargo` target directories inside `dist/`, they were
being copied for exporting!
This is more longwinded, but fixes a few priority issues, and it's much
more maintainable and extensible.
This will be used preferentially over a local directory if available,
minimizing wait times for creating new projects.
@arctic-hen7 arctic-hen7 marked this pull request as ready for review July 17, 2022 22:35
@arctic-hen7 arctic-hen7 merged commit 4682b9d into main Jul 18, 2022
@arctic-hen7 arctic-hen7 deleted the feat-cli-improvements branch July 18, 2022 01:51
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

Successfully merging this pull request may close these issues.

1 participant