code-playpad 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -4
- package/dist/COMPILER-LICENSE-AUDIT.md +104 -0
- package/dist/COMPILER-NOTICES.txt +16973 -0
- package/dist/THIRD-PARTY-NOTICES.txt +102 -0
- package/dist/cdn.js +2 -2
- package/dist/compiler-license-manifest.json +198 -0
- package/dist/{config-D9w0xYhX.js → config-cwuPIQ48.js} +1 -1
- package/dist/cpp-D2TrExLz.js +1 -0
- package/dist/cpp-DakNa4ys.js +6 -0
- package/dist/dist-CNOK8CHE.js +6 -0
- package/dist/{element-BTbopmDc.js → element-BQWrbSEp.js} +4 -4
- package/dist/element.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{java-p3d2UdsW.js → java-DeBiVPXO.js} +1 -1
- package/dist/{java-CAuQOfuB.js → java-Xf1xYcVv.js} +1 -1
- package/dist/{javascript-BgIyjzbD.js → javascript-CTY3U1Mc.js} +1 -1
- package/dist/{javascript-BUUMtBcS.js → javascript-DkarEcEB.js} +1 -1
- package/dist/{pyodide-BCtQRDyT.js → pyodide-B1U3JD9Z.js} +1 -1
- package/dist/{pyodide-DKoE92s5.js → pyodide-BGBI232i.js} +1 -1
- package/dist/react.js +1 -1
- package/dist/runtime/compiler-assets.d.ts +5 -0
- package/dist/runtime/compiler-cache.d.ts +9 -0
- package/dist/runtime/config.d.ts +11 -0
- package/dist/runtime/cpp/assets.d.ts +6 -0
- package/dist/runtime/cpp/project.d.ts +9 -0
- package/dist/runtime/cpp/worker.d.ts +1 -0
- package/dist/runtime/cpp-worker.generated.d.ts +1 -0
- package/dist/runtime/cpp.d.ts +3 -0
- package/dist/runtime/worker-runtime.d.ts +1 -0
- package/dist/standalone.js +9 -9
- package/dist/types.d.ts +13 -1
- package/dist/{worker-runtime-C2AhIV7u.js → worker-runtime-DfYet3xy.js} +2 -2
- package/dist/{worker-runtime-DJs9O_oY.js → worker-runtime-Dq71SbjR.js} +2 -2
- package/package.json +17 -5
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ entirely in the reader's browser. No backend, no iframe, no sign-up.
|
|
|
9
9
|
**[Live demo →](https://code-playpad.swengr.com)**
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/code-playpad@0.
|
|
12
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/code-playpad@0.9.0/dist/standalone.js"></script>
|
|
13
13
|
|
|
14
14
|
<code-playpad height="auto">
|
|
15
15
|
print("hello from a static page")
|
|
@@ -159,6 +159,20 @@ under a second. The engine stops a runaway program after 200 million steps
|
|
|
159
159
|
the evidence behind it and every known difference from the JDK, is in
|
|
160
160
|
[JAVA-COMPATIBILITY.md](https://cdn.jsdelivr.net/npm/code-playpad/JAVA-COMPATIBILITY.md), which ships in the package.
|
|
161
161
|
|
|
162
|
+
## Experimental C/C++
|
|
163
|
+
|
|
164
|
+
`language="c"` (C17) and `language="cpp"` (C++20) compile and run in a worker
|
|
165
|
+
with a real Clang compiler, prefilled stdin and Stop. They are experimental:
|
|
166
|
+
|
|
167
|
+
- **You host the compiler.** It is not in the npm package and there is no
|
|
168
|
+
hosted copy yet. Build the pinned toolchain from this repository, host it,
|
|
169
|
+
and call `configureCpp({ indexURL })`. Without that, Run explains what is
|
|
170
|
+
missing and downloads nothing.
|
|
171
|
+
- **Not yet tested on physical phones.** Desktop Chromium, WebKit and Firefox
|
|
172
|
+
pass; iPhone Safari and Android Chrome have not been run.
|
|
173
|
+
|
|
174
|
+
See [setup and limits](https://github.com/stancs/code-playpad/blob/main/docs/COMPILER-RUNTIMES.md).
|
|
175
|
+
|
|
162
176
|
## Download size
|
|
163
177
|
|
|
164
178
|
What a page downloads once a reader presses Run, with the CDN build, as
|
|
@@ -173,7 +187,8 @@ actually sent.
|
|
|
173
187
|
| TypeScript | **227.3 KB** (0.5.2: with the 46.9 KB transform) | nothing (before 0.5.2: Sucrase from esm.sh, 72 KB) | 179.9 KB |
|
|
174
188
|
| Java | **288.1 KB** (0.8.0: engine 0.39) | nothing | 216.4 KB |
|
|
175
189
|
| Java, with collections | **373.1 KB** (0.8.0) | nothing | 233.2 KB |
|
|
176
|
-
|
|
|
190
|
+
| C or C++ (experimental) | **187.0 KB** | the compiler, about **29.9 MB**, from the host you configure | — |
|
|
191
|
+
| All five | 520.0 KB | Pyodide and the C/C++ compiler | 273.9 KB |
|
|
177
192
|
|
|
178
193
|
- **Every row includes a 144.5 KB shared base:** the editor (CodeMirror) and
|
|
179
194
|
the widget, the same as in 0.3.0.
|
|
@@ -188,11 +203,23 @@ actually sent.
|
|
|
188
203
|
that uses them: `java.time` 16.8 KB, `java.math` 6.7 KB,
|
|
189
204
|
`Pattern`/`Matcher` 2.7 KB and `BitSet` 2.3 KB. The rows above leave
|
|
190
205
|
them out.
|
|
206
|
+
- C/C++: 42.5 KB (the 7.9 KB runtime plus 34.6 KB of C/C++ syntax
|
|
207
|
+
highlighting). See the C/C++ note below.
|
|
191
208
|
- The Java figures for 0.8.0 are the 0.4.0 measurements plus what the
|
|
192
209
|
engine's two chunks changed by in the build's gzip sizes (engines 0.28
|
|
193
210
|
to 0.39 added the collection staples, library subclasses, the tutorial
|
|
194
211
|
APIs, regex, java.time, javac's error recovery and messages, packages
|
|
195
212
|
and more; 0.32 moved the rarely used classes out of the library).
|
|
213
|
+
- **C and C++ (experimental)** were measured on 2026-10-29 as
|
|
214
|
+
the difference between pages with and without C/C++. Measured that day,
|
|
215
|
+
whole pages come out 4–8 KB larger than this table, with or without the
|
|
216
|
+
C/C++ code, so the C/C++ and All five rows add the measured 42.5 KB to this
|
|
217
|
+
table's figures. The compiler is the large part: Clang 15.2 MB, the linker 8.8 MB,
|
|
218
|
+
and headers and libraries 5.9 MB, gzipped as a host would typically send
|
|
219
|
+
them. It downloads on the first Run, from the address given to
|
|
220
|
+
`configureCpp` (you host it), and is cached after that. C and C++ share it, so a page
|
|
221
|
+
with both downloads it once. 0.3.0 had no C/C++, so its All five figure is
|
|
222
|
+
its four-language page.
|
|
196
223
|
- **Java grew** from 0.3.0 because the subset did, from basic Java to most of
|
|
197
224
|
what practice programs use (see the version history). The owner treats
|
|
198
225
|
download size as secondary to coverage. The package's size checks still
|
|
@@ -217,7 +244,7 @@ actually sent.
|
|
|
217
244
|
### From a CDN — nothing to install
|
|
218
245
|
|
|
219
246
|
```html
|
|
220
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/code-playpad@0.
|
|
247
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/code-playpad@0.9.0/dist/standalone.js"></script>
|
|
221
248
|
```
|
|
222
249
|
|
|
223
250
|
This is the `standalone` build: CodeMirror is bundled in, so a static blog post
|
|
@@ -848,6 +875,28 @@ warms every other page on the site.
|
|
|
848
875
|
|
|
849
876
|
## Version history
|
|
850
877
|
|
|
878
|
+
### 0.9.0
|
|
879
|
+
|
|
880
|
+
Adds experimental C and C++. Nothing else changed: Python, JavaScript,
|
|
881
|
+
TypeScript and Java behave as in 0.8.0, and existing pages grow by about
|
|
882
|
+
0.5 KB.
|
|
883
|
+
|
|
884
|
+
- **`language="c"` and `language="cpp"`** (C17 and C++20) compile with Clang 20
|
|
885
|
+
and link with LLD, compiled to WebAssembly, in a worker. Multiple files,
|
|
886
|
+
prefilled stdin, Stop, a wall-clock limit and streamed output all work.
|
|
887
|
+
Programs get stdin, stdout and stderr only; exceptions and threads are not
|
|
888
|
+
supported, and live interactive stdin is not implemented.
|
|
889
|
+
- **`configureCpp({ indexURL })` is required.** The compiler (about 29.9 MB
|
|
890
|
+
gzipped) is not in this package and has no hosted copy yet, so you build and
|
|
891
|
+
host it yourself. Its files are checked by SHA-256 and cached after the first
|
|
892
|
+
Run. Without the setting, Run explains what is missing and downloads nothing.
|
|
893
|
+
- **Tested on desktop only:** Chromium, WebKit and Firefox. Physical iPhone and
|
|
894
|
+
Android runs have not been done.
|
|
895
|
+
- **`RunOptions`** gains `onProgress` and `timeoutMs`, and `Result` gains
|
|
896
|
+
`memory`.
|
|
897
|
+
- **New optional peer dependency:** `@codemirror/lang-cpp`, for highlighting
|
|
898
|
+
with a bundler.
|
|
899
|
+
|
|
851
900
|
### 0.8.0
|
|
852
901
|
|
|
853
902
|
Java engine 0.34.1 → 0.39.0, each change checked against JDK 25. Nothing
|
|
@@ -883,7 +932,7 @@ class of that folder's package, as on the JDK.
|
|
|
883
932
|
first loads, as the JDK's launcher does, so its errors appear at that
|
|
884
933
|
point in the run.
|
|
885
934
|
|
|
886
|
-
Markup and API written against 0.1.3 still work on 0.
|
|
935
|
+
Markup and API written against 0.1.3 still work on 0.9.0, with one exception, in
|
|
887
936
|
0.5.1: an `entry` that names none of a widget's files is now an error.
|
|
888
937
|
|
|
889
938
|
### 0.7.0
|
|
@@ -1183,6 +1232,12 @@ their own MIT licences, reproduced in full in `dist/THIRD-PARTY-NOTICES.txt`.
|
|
|
1183
1232
|
Pyodide (MPL-2.0) is fetched from a CDN at runtime and is not redistributed by
|
|
1184
1233
|
this package.
|
|
1185
1234
|
|
|
1235
|
+
Experimental C/C++ downloads separate compiler assets with additional
|
|
1236
|
+
third-party terms; those assets are not MIT-only. Their notices ship in
|
|
1237
|
+
`dist/COMPILER-NOTICES.txt`. The pinned C/C++ rebuild passes its scoped license
|
|
1238
|
+
inventory gate; see the [compiler license audit](docs/COMPILER-LICENSE-AUDIT.md)
|
|
1239
|
+
and [rebuild and remaining gates](docs/CPP-REBUILD.md).
|
|
1240
|
+
|
|
1186
1241
|
The Java engine is original code under the same MIT licence. Java is a trademark
|
|
1187
1242
|
of Oracle and/or its affiliates; code-playpad is not affiliated with, endorsed
|
|
1188
1243
|
by, or certified by Oracle, and its Java support is a documented subset, not a
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Compiler license audit — 2026-10-27
|
|
2
|
+
|
|
3
|
+
**Disposition: the project's own code remains MIT. The license inventory gate
|
|
4
|
+
passes for the pinned rebuilt C/C++ artifact set and its notice companions.**
|
|
5
|
+
Release still needs the owner's approval. The old browsercc
|
|
6
|
+
binary set is superseded, not retroactively cleared. See [CPP-REBUILD.md](CPP-REBUILD.md)
|
|
7
|
+
for exact scope, build evidence and remaining non-license release gates.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## What is cleared and what was added
|
|
11
|
+
|
|
12
|
+
The bundled integration uses `@bjorn3/browser_wasi_shim` 0.4.2 under its MIT option
|
|
13
|
+
and adapts the MIT Weblings worker protocol/sysroot format at
|
|
14
|
+
`d0cd7a9f3af7d8249b3948ac0e19d2afc0d01633`. Their full notices already reside in
|
|
15
|
+
`dist/THIRD-PARTY-NOTICES.txt`; the distribution check now verifies both the names
|
|
16
|
+
and complete text. The CodeMirror C++ grammar retains its MIT notice too.
|
|
17
|
+
The project's LICENSE is unchanged. No compiler binaries are committed or packed.
|
|
18
|
+
|
|
19
|
+
Added a separate `third-party/compiler/manifest.json` and source notice corpus.
|
|
20
|
+
Each snapshot records its immutable source URL and SHA-256. The build emits
|
|
21
|
+
`dist/COMPILER-NOTICES.txt`, this audit, and `compiler-license-manifest.json` so
|
|
22
|
+
npm consumers receive the findings and available external notices. The local
|
|
23
|
+
asset-preparation script also copies these companions beside each toolchain.
|
|
24
|
+
The rebuilt C/C++ additions resolve its scoped inventory gaps.
|
|
25
|
+
|
|
26
|
+
`npm run check:compiler-licenses` verifies notice hashes. Adding `-- --release`
|
|
27
|
+
fails until the owner sets `releaseApproved`. Use `-- --release --toolchain=cpp`
|
|
28
|
+
for the rebuilt C/C++ license gate, which passes. This is an explicit
|
|
29
|
+
compiler release gate, not a claim that a normal build is approved for release.
|
|
30
|
+
|
|
31
|
+
## Historical browsercc C/C++ findings (superseded by the pinned rebuild)
|
|
32
|
+
|
|
33
|
+
The reviewed npm archive is browsercc 0.1.1, source
|
|
34
|
+
`86168bacf0fe7c662e3e65a2e3006ceb159cd0dc`; exact asset hashes are recorded in
|
|
35
|
+
`src/runtime/cpp/assets.ts` and the audit manifest. The wrapper's MIT LICENSE
|
|
36
|
+
has no explicit copyright-holder line; it is preserved verbatim. Package metadata
|
|
37
|
+
names Daniel Bertalan as author; no invented copyright line was added.
|
|
38
|
+
|
|
39
|
+
The recipe builds Clang/LLD from LLVM 20.1.2 (`58df0ef89dd64126512e4ee27b4ac3fd8ddf6247`).
|
|
40
|
+
It obtains libc++, libc++abi and compiler builtins from WASI SDK 25's LLVM revision
|
|
41
|
+
`ab4b5a2db582958af1ee308a790cfdb42bd24720`, and wasi-libc revision
|
|
42
|
+
`574b88da481569b65a237cb80daf9a2d5aeaf82d`. These are distinct LLVM inputs.
|
|
43
|
+
Their primary license texts are retained, including LLVM exceptions and legacy
|
|
44
|
+
NCSA terms. wasi-libc's umbrella references Apache/LLVM, Apache, MIT, cloudlibc
|
|
45
|
+
BSD-2-Clause, musl MIT, musl-fts BSD-3-Clause and allocator notices; these referenced
|
|
46
|
+
texts and allocator attribution headers are included.
|
|
47
|
+
|
|
48
|
+
The recipe explicitly removes sysroot `share/` and VERSION (share/ was later
|
|
49
|
+
confirmed to contain symbol/configuration data, not a standalone license bundle),
|
|
50
|
+
and the distributed
|
|
51
|
+
sysroot contains no standalone license/copyright files. It also selects Emscripten
|
|
52
|
+
`latest`, with no immutable SDK revision or complete linked-host-library list.
|
|
53
|
+
The compiler Wasm files contain no producer/custom metadata that resolves that
|
|
54
|
+
version. Root LLVM notices explicitly defer to component/file-level third-party
|
|
55
|
+
terms; copying only the root license is not a complete compiler notice bundle.
|
|
56
|
+
|
|
57
|
+
**Historical C/C++ blockers (resolved by replacement):** obtain upstream provenance plus a complete notice/SBOM bundle,
|
|
58
|
+
or rebuild from pinned LLVM, Emscripten and WASI inputs while preserving notices.
|
|
59
|
+
Account for Emscripten glue, linked libc/libc++/allocator code, and LLVM's included
|
|
60
|
+
third-party code. Compare any replacement hashes and rerun browser/size tests.
|
|
61
|
+
The current CDN pointer does not make the missing attribution irrelevant.
|
|
62
|
+
|
|
63
|
+
## Rust (removed 2026-10-29)
|
|
64
|
+
|
|
65
|
+
An experimental Rust runtime was removed before release. Its compiler came
|
|
66
|
+
from a fork whose custom backend commits carry no license of their own, so no
|
|
67
|
+
license review could clear it. The owner chose not to seek one; any future Rust
|
|
68
|
+
runtime would replace those commits with project-authored code. Its audit, notice
|
|
69
|
+
corpus and evidence remain in git history on branch `codex/c-cpp-runtime`.
|
|
70
|
+
|
|
71
|
+
## Distribution and generated user programs
|
|
72
|
+
|
|
73
|
+
Retain upstream copyright/license texts and applicable NOTICE files; identify
|
|
74
|
+
modified upstream files where required by their licenses. Our separately authored
|
|
75
|
+
integration remains MIT. Upstream recipe modifications (sysroot rearrangement,
|
|
76
|
+
added bits/stdc++.h and stripped sections) are not our original authorship and need provenance in any replacement distribution.
|
|
77
|
+
|
|
78
|
+
Compiling a user's program does not by itself relicense its original source.
|
|
79
|
+
Linked libc/libc++ and other runtime code have their own terms. LLVM's
|
|
80
|
+
exception is relevant to embedded object code, not a blanket exemption for
|
|
81
|
+
redistributing the compiler, unrelated libraries or all generated programs.
|
|
82
|
+
Don't tell downstream users that every output is automatically MIT or obligation-free.
|
|
83
|
+
|
|
84
|
+
## Release checklist / owner actions
|
|
85
|
+
|
|
86
|
+
1. Keep C/C++ scoped to the rebuilt, verified hashes and notice companions.
|
|
87
|
+
2. Publish complete, immutable compiler distributions with companion notices;
|
|
88
|
+
test the actual CDN compression, CORS and notice URLs. Current transfers are
|
|
89
|
+
measured with a local gzip mirror, not verified production hosting.
|
|
90
|
+
3. Complete physical iPhone Safari and Android Chrome memory/lifecycle/cache
|
|
91
|
+
testing. Desktop Chromium, WebKit and Firefox pass 22 checks each.
|
|
92
|
+
4. Run the packed React/bundler/CSP checks, and decide interactive-input scope.
|
|
93
|
+
See compiler-validation.md for the detailed non-license gates.
|
|
94
|
+
|
|
95
|
+
Sources: immutable URLs for every retained text are in the manifest; the build
|
|
96
|
+
recipe is [browsercc](https://github.com/BertalanD/browsercc/blob/86168bacf0fe7c662e3e65a2e3006ceb159cd0dc/build.sh),
|
|
97
|
+
superseded by the pinned rebuild in `toolchains/cpp/`.
|
|
98
|
+
|
|
99
|
+
Validation: notice hashes, 77 tests, typecheck, build and distribution checks pass.
|
|
100
|
+
The npm dry-run (2026-10-29, after Rust's removal) contains all three audit
|
|
101
|
+
companions (932,733 bytes compressed, 77 files). Local asset preparation copies
|
|
102
|
+
them beside the toolchain. The combined release check fails until the owner
|
|
103
|
+
approves release; the rebuilt C/C++ check passes; successful packaging is not
|
|
104
|
+
release clearance.
|