Commit 5ad4e78
UN-3185 [FIX] Install global Prism unconditionally + correct rationale (review)
Address PR review:
- silent-failure-hunter: a `!globalThis.Prism` guard could leave a different,
pre-existing Prism in place, so the add-ons extend one instance while
JsonView's highlightAll() reads another -> JSON silently unhighlighted.
Assign unconditionally so the global is provably our core instance.
- comment-analyzer: the prior comment blamed evaluation order yet relied on it
to justify the fix. Rewrite: relying on prismjs core's self-install is
unreliable under code-splitting; the explicit globalThis assignment (from
first-party code imported before the add-ons) is the deterministic fix.
Rebuilt: emitted chunk runs `globalThis.Prism = <core>` immediately before
`Prism.languages.json = ...`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 3798e91 commit 5ad4e78
1 file changed
Lines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
0 commit comments