Skip to content

Commit ae693fa

Browse files
committed
More contribution docs
1 parent 58b9563 commit ae693fa

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,33 @@ They should be synced in from the `bsb` build. Don't take them from other places
88

99
### `.compiler.log`
1010

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:
1212

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.
1717

1818
Barring FS errors, there should be no other state to `.compiler.log`.
1919

20-
### States of Diagnostics
20+
### State 1
2121

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` -->
2338

2439
### Files from Other Projects
2540

@@ -45,6 +60,8 @@ The formatted result should be taken as-is, without any extra string trimming an
4560

4661
### Formatting Errors
4762

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+
4865
- should the format still show errors when the build isn't running?
4966
- should it show during various states of `.compiler.log`?
5067

0 commit comments

Comments
 (0)