You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+24-7Lines changed: 24 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,33 @@ They should be synced in from the `bsb` build. Don't take them from other places
8
8
9
9
### `.compiler.log`
10
10
11
-
The build output is streamed into `lib/bs/.compiler.log`. Here are its various states:
11
+
The build output is streamed into `lib/bs/.compiler.log`. Here are its various states, numbered here:
12
12
13
-
- Doesn't exist: artifacts not built yet, or cleaned away.
14
-
- Present but empty: currently building, no error yet.
15
-
- Present, non-empty, without a final line `# Done`: still building.
16
-
- Present, with the final line `# Done`: finished building.
13
+
1. Doesn't exist: artifacts not built yet, or cleaned away.
14
+
2. Present but empty: currently building, no error yet.
15
+
3. Present, non-empty, without a final line `# Done`: still building.
16
+
4. Present, with the final line `# Done`: finished building.
17
17
18
18
Barring FS errors, there should be no other state to `.compiler.log`.
19
19
20
-
### States of Diagnostics
20
+
### State 1
21
21
22
-
- Artifacts cleaning through `bsb -clean` removes `.compiler.log`, as mentioned above. If that's the case, remove the diagnostics in the editor too. One could argue that they should be kept, but that's misleading UX-wise, and harder to implement correctly.
22
+
Artifacts cleaning through `bsb -clean` removes `.compiler.log` and turns into state 1. If that's the case, remove the diagnostics in the editor too. One could argue that they should be kept, but that's misleading UX-wise, and harder to implement correctly.
23
+
24
+
### Streaming Update of Diagnostics
25
+
26
+
After saving a file and running the build, the results stream into the log file. Unfortunately, UX-wise, in the editor, this might look like the diagnostics are suddenly gone then coming back in file by file. This looks bad. To remediate:
27
+
- If the log file is in state 2 (see state numbers above), don't wipe the existing diagnostics yet.
28
+
- If it's in state 3, update those particular files' diagnostics.
29
+
- If in state 4, finish by clean up the rest of the old diagnostics. This means there's a bit of bookeeping needed here. Make sure you get it right. It's possible for a build to be interrupted (and therefore state 4 never reached) and restarted.
30
+
31
+
Even this fix isn't great. Ideally, the editor's diagnostics can be greyed out while we're updating them...
32
+
33
+
### Stale Diagnostics Detection
34
+
35
+
To check whether the artifacts are stale, do **not** check `.bsb.lock` at the project root. This is unreliable, since it's possible that `bsb` wasn't running in watcher mode. We also don't want to encourage overuse of the watcher mode, though it seems increasingly common.
36
+
37
+
<!-- Instead, do `bsb.exe -- -n` -->
23
38
24
39
### Files from Other Projects
25
40
@@ -45,6 +60,8 @@ The formatted result should be taken as-is, without any extra string trimming an
45
60
46
61
### Formatting Errors
47
62
63
+
The errors returned from `bsc.exe -format` should be discarded; in theory, they should have been duplicates of the errors from `.compiler.log`.
64
+
48
65
- should the format still show errors when the build isn't running?
49
66
- should it show during various states of `.compiler.log`?
0 commit comments