Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Watch rust files and rebuild during dev#5543

Merged
lukastaegert merged 2 commits intomasterfrom
watch-rust-dev
Jun 23, 2024
Merged

Watch rust files and rebuild during dev#5543
lukastaegert merged 2 commits intomasterfrom
watch-rust-dev

Conversation

@lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Jun 8, 2024

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This greatly improves the usefulness of npm run dev by rebuilding the browser wasm build on Rust changes, which will also update and reload the REPL if it is open.

I went for nodemon because

  • It is easy to install via npm, while to my understanding, cargo-watch would have needed to be installed manually
  • It works really well as opposed to alternatives like chokidar-cli that completely failed with the patterns I provided and output a lot of noise

@vercel
Copy link

vercel bot commented Jun 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2024 8:13am

@github-actions
Copy link

github-actions bot commented Jun 8, 2024

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#watch-rust-dev

Notice: Ensure you have installed the latest stable Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-bvzbjahgl-rollup-js.vercel.app/repl/?pr=5543

@github-actions
Copy link

github-actions bot commented Jun 8, 2024

Performance report!

Rough benchmark

Command Mean [s] Min [s] Max [s] Relative
node _benchmark/previous/bin/rollup -i ./perf/entry.js -o _benchmark/result/previous.js 9.109 ± 0.059 9.056 9.173 1.00
node _benchmark/current/bin/rollup -i ./perf/entry.js -o _benchmark/result/current.js 9.150 ± 0.051 9.097 9.200 1.00 ± 0.01

Internal benchmark

  • BUILD: 8188ms, 748 MB
    • initialize: 0ms, 26.1 MB
    • generate module graph: 3150ms, 574 MB
      • generate ast: 1506ms, 567 MB
    • sort and bind modules: 453ms (+12ms, +2.8%), 620 MB
    • mark included statements: 4590ms, 748 MB
      • treeshaking pass 1: 1566ms, 715 MB
      • treeshaking pass 2: 752ms, 744 MB
      • treeshaking pass 3: 291ms, 745 MB
      • treeshaking pass 4: 270ms, 750 MB
      • treeshaking pass 5: 317ms, 747 MB
      • treeshaking pass 6: 259ms, 754 MB
      • treeshaking pass 7: 241ms, 755 MB
      • treeshaking pass 8: 236ms, 756 MB
      • treeshaking pass 9: 213ms, 754 MB
      • treeshaking pass 10: 215ms, 752 MB
      • treeshaking pass 11: 212ms, 748 MB
  • GENERATE: 889ms, 1.03 GB
    • initialize render: 0ms, 914 MB
    • generate chunks: 84ms, 927 MB
      • optimize chunks: 0ms, 916 MB
    • render chunks: 788ms, 1 GB (+2%)
    • transform chunks: 16ms, 1.03 GB
    • generate bundle: 0ms, 1.03 GB

@codecov
Copy link

codecov bot commented Jun 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.07%. Comparing base (0b49ec8) to head (5a4039f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5543   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files         238      238           
  Lines        9544     9544           
  Branches     2437     2437           
=======================================
  Hits         9456     9456           
  Misses         58       58           
  Partials       30       30           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

github-actions bot commented Jul 8, 2024

This PR has been released as part of [email protected]. You can test it via npm install rollup.

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