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

watcher.js auto updates sub library modules for hot-reloading greatness #393

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

NotChristianGarcia
Copy link
Member

Overview:

Added watcher.js, when ran with npm run watcher the script will auto update sub library modules for hot-reloading greatness.
Builds sub libraries with npx tsc --build ./tsconfig.json when appropriate.
Copies changed css and scss files when appropriate (tsx and s/css have different logic).

Summary of Changes:

  • Added watcher.js along with npm run watcher
  • Also added incremental to all sub library tsconfig.json files. This allows tsx to build only changed files, not forcing a full reload.

Testing Steps:

  1. Run both npm run start and npm run watcher concurrently.
  2. Make changes to a file in tapisui-common.
  3. Watch as the script logs which file is changed and as vite reloading reloads any changes.
  4. You can do the same for css/scss. Change tapis-ui/lib/tapisui-common/src/ui/Tabs/Tabs.module.scss and you'll get a hot-reload.

UI Photos:

Screenshot from 2024-07-08 06-57-35

Notes:

As of now a developer would need to run npm run start and npm run watcher as two separate processes.
Sometimes changes to s/css force a large-ish reload. I think that's when the changes proliferate to many places. Still pretty quick.

This all might be doable with vite in some other way. I couldn't find too much in that regard online.

Added chokidar library which provides watcher utilities.

…te sub library modules for hot-reloading greatness.
@nathandf nathandf merged commit 2052163 into dev Jul 8, 2024
4 checks passed
@NotChristianGarcia NotChristianGarcia deleted the watcher branch July 8, 2024 18: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.

2 participants