Skip to content

perf(js_run_devserver): allow direct file sync#2017

Draft
ramzesucr wants to merge 1 commit intoaspect-build:2.xfrom
ramzesucr:add-support-for-direct-file-sync
Draft

perf(js_run_devserver): allow direct file sync#2017
ramzesucr wants to merge 1 commit intoaspect-build:2.xfrom
ramzesucr:add-support-for-direct-file-sync

Conversation

@ramzesucr
Copy link

@ramzesucr ramzesucr commented Nov 13, 2024

Tools like vite have hot reload feature which is useful during development. This feature works when js_run_devserver and ibazel are used. Current experience feels weird due to long reload time thus it invalidates the usage of hot reload. In order to have a better performance I propose synchronizing the non node_module files directly from workspace workspace source -> devserver sandbox, instread of current workspace source -> bazel-out -> devserver sandbox behaviour. It might not work for every use case, so it's hidden behind direct_sync attribute. The file sync is still necessary after bazel build since node_modules might have changed.


Changes are visible to end-users: yes/no

  • Searched for relevant documentation and updated as needed: yes/no
  • Breaking change (forces users to change their own code or config): yes/no
  • Suggested release notes appear below: yes/no

Test plan

  • Covered by existing test cases
  • New test cases added
  • Manual testing; please provide instructions so we can reproduce:

@CLAassistant
Copy link

CLAassistant commented Nov 13, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ramzesucr ramzesucr force-pushed the add-support-for-direct-file-sync branch from dab5c01 to 29ce861 Compare November 13, 2024 14:14
@aspect-workflows
Copy link

aspect-workflows bot commented Nov 13, 2024

Test

2 test targets passed

Targets
//js/private/test/js_run_devserver:js_run_devserver_test [k8-fastbuild]                                 378ms
//js/private/test/js_run_devserver:node_modules_symlink_to_execroot_test [k8-fastbuild]                 422ms

Total test execution time was 800ms. 209 tests (99.1%) were fully cached saving 33s.


Test

e2e/bzlmod

All tests were cache hits

5 tests (100.0%) were fully cached saving 857ms.


Test

e2e/gyp_no_install_script

All tests were cache hits

2 tests (100.0%) were fully cached saving 503ms.


Test

e2e/js_image_oci

All tests were cache hits

1 test (100.0%) was fully cached saving 7s.


Test

e2e/npm_link_package

All tests were cache hits

3 tests (100.0%) were fully cached saving 820ms.


Test

e2e/npm_link_package-esm

All tests were cache hits

3 tests (100.0%) were fully cached saving 1s.


Test

e2e/npm_translate_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 34ms.


Test

e2e/npm_translate_lock_empty

All tests were cache hits

1 test (100.0%) was fully cached saving 34ms.


Test

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 171ms.


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 129ms.


Test

e2e/npm_translate_lock_replace_packages

All tests were cache hits

3 tests (100.0%) were fully cached saving 503ms.


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 222ms.


Test

e2e/npm_translate_package_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 131ms.


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 131ms.


Test

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 590ms.


Test

e2e/pnpm_lockfiles

All tests were cache hits

40 tests (100.0%) were fully cached saving 3s.


Test

e2e/pnpm_workspace

All tests were cache hits

10 tests (100.0%) were fully cached saving 3s.


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

12 tests (100.0%) were fully cached saving 2s.


Test

e2e/repo_mapping

All tests were cache hits

2 tests (100.0%) were fully cached saving 474ms.


Test

e2e/rules_foo

All tests were cache hits

2 tests (100.0%) were fully cached saving 470ms.


Test

e2e/runfiles

All tests were cache hits

1 test (100.0%) was fully cached saving 443ms.


Test

e2e/vendored_node

All tests were cache hits

1 test (100.0%) was fully cached saving 199ms.


Buildifier      Format

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.

2 participants