Commit 6cdb060
authored
Add JavaScript hot-reloading to frontend template (#17)
* Add JavaScript hot-reloading to frontend template
- Add js_reloader.erl module to handle JavaScript rebuilds
- Configure reloader to watch assets/js directory for .js file changes
- Runs npm run build:js when JavaScript files are modified
- Broadcasts js reload event via arizona_pubsub for live updates
- Includes error handling for failed JS builds with output logging
* Add js_reloader.erl to frontend template definition
- Include js_reloader.erl in arizona.frontend.template file list
- Ensures JS reloader module is created when generating new projects
- Fixes missing template entry for JavaScript hot-reloading functionality
* Add debounce timing to hot-reload watchers
- Add 50ms debounce to CSS reloader to prevent excessive rebuilds
- Add 20ms debounce to JS reloader for faster feedback on JavaScript changes
- Optimizes performance by batching rapid file changes
- Reduces unnecessary build cycles during development1 parent 66a8512 commit 6cdb060
File tree
3 files changed
+24
-1
lines changed- priv/templates
- arizona.frontend
- config
- src
3 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments