wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ffe50ed02
commit
19fcf60599
459 changed files with 17862 additions and 17603 deletions
|
|
@ -1,33 +1,33 @@
|
|||
# reload.ludic - a developer's templates and stylesheets read again when they change on disk: every
|
||||
# file is re-read in the order it was first loaded (so an import is there before its importer), and
|
||||
# the screens' state is kept, as React's fast refresh keeps it. True when anything changed.
|
||||
export function ui_reload() -> bool {
|
||||
var changed = uc_reload()
|
||||
for i in 0 .. len(lib_files) {
|
||||
let f = lib_files[i]
|
||||
if f.disk and lib_text(f.path) != f.src { changed = true }
|
||||
export function ui_reload(ui_st: mut UiState) -> bool {
|
||||
var changed = uc_reload(ui_st)
|
||||
for i in 0 .. len(ui_st.lib_files) {
|
||||
let f = ui_st.lib_files[i]
|
||||
if f.disk and lib_text(ui_st, f.path) != f.src { changed = true }
|
||||
}
|
||||
if not changed { return false }
|
||||
ui_errs = new []string
|
||||
if len(lib_files) == 0 {
|
||||
ui_st.ui_errs = new []string
|
||||
if len(ui_st.lib_files) == 0 {
|
||||
print(`ui: templates reloaded`)
|
||||
return true
|
||||
}
|
||||
let old = lib_files
|
||||
lib_files = new []UiFile
|
||||
lib_screen_names = new []string
|
||||
lib_screens = new []UiTpl
|
||||
ui_errs = new []string
|
||||
let old = ui_st.lib_files
|
||||
ui_st.lib_files = new []UiFile
|
||||
ui_st.lib_screen_names = new []string
|
||||
ui_st.lib_screens = new []UiTpl
|
||||
ui_st.ui_errs = new []string
|
||||
for i in 0 .. len(old) {
|
||||
let f = old[i]
|
||||
var have = false
|
||||
for k in 0 .. len(lib_files) {
|
||||
if lib_files[k].path == f.path { have = true }
|
||||
for k in 0 .. len(ui_st.lib_files) {
|
||||
if ui_st.lib_files[k].path == f.path { have = true }
|
||||
}
|
||||
if have { continue }
|
||||
if f.disk { lib_file(f.path) } else { ui_load_text(f.src, f.path) }
|
||||
if f.disk { lib_file(ui_st, f.path) } else { ui_load_text(ui_st, f.src, f.path) }
|
||||
}
|
||||
uc_invalidate()
|
||||
uc_invalidate(ui_st)
|
||||
print(`ui: templates reloaded`)
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue