Skip to content

Commit 3f76c88

Browse files
authored
chore(REL-03): prepare compiler and browser APIs for 0.2.0 (#39)
1 parent 804a70f commit 3f76c88

18 files changed

Lines changed: 165 additions & 35 deletions

‎.github/workflows/ci.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
run: python -m pip install --upgrade build twine
3434
- name: Build sdist and wheel from sdist
3535
run: python -m build
36+
- name: Verify distribution file allowlists
37+
run: python scripts/check_distribution_files.py
3638
- name: Check distribution metadata
3739
run: python -m twine check --strict dist/*
3840
- name: Install wheel with published dependencies

‎.github/workflows/release.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
run: python -m pip install --upgrade build twine
4646
- name: Build sdist and wheel from the sdist
4747
run: python -m build
48+
- name: Verify distribution file allowlists
49+
run: python scripts/check_distribution_files.py
4850
- name: Check distribution metadata
4951
run: python -m twine check --strict dist/*
5052
- name: Install the wheel

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.2.0
4+
5+
- Add the binding-aware source compiler, deterministic ES module emitter and original-source diagnostics/maps.
6+
- Compile explicitly supplied local modules and re-exports with selected helper and notice closure.
7+
- Add lazy coroutine/Promise awaits and named browser worker/host capabilities with stop/restart.
8+
- Verify the approved corpus across CPython, Node and Chromium and record scoped payload/startup/memory measurements.
9+
- Preserve the JavaScript runtime namespace and existing Fetch/JSON dependency ranges.
10+
311
## 0.1.0
412

513
- Introduce the case-sensitive `JavaScript` namespace with Object, sparse Array,

‎IMPLEMENTATION_PLAN.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,3 +489,13 @@ helpers, maps, notices, metadata/harness and compressed payloads, with raw warm
489489
build, fresh/warm context startup and separate dedicated-worker V8 heap samples.
490490
These synchronous compiler fixtures do not include the browser-host/PWA shell;
491491
complete application and future interpreter measurements remain separate scopes.
492+
493+
## 0.2.0 publication plan
494+
495+
[REL-03](https://github.com/outside-labs/Python-JavaScript/issues/38) publishes
496+
the merged compiler, module/async/browser profiles, conformance and measurements.
497+
See the [release contract](docs/release-0.2.0.md). Runtime companion dependency
498+
ranges remain unchanged; compiler and browser assets are in the distributions.
499+
Strict artifact allowlists, installed-wheel/sdist and browser checks, passing
500+
final main CI, PyPI/workflow hash comparison and a fresh PyPI install are gates.
501+
The independent browser source interpreter remains a separate pocket-python task.

‎README.md‎

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ case-sensitive `JavaScript` namespace. An alpha compatibility layer with a
55
documented subset of ECMAScript behavior.
66

77
```sh
8-
python -m pip install Python-JavaScript==0.1.0
8+
python -m pip install Python-JavaScript==0.2.0
99
```
1010

1111
```python
@@ -78,19 +78,26 @@ indices follow JavaScript rules: `values[-1]` is a named property, and
7878
`values.at(-1)` accesses the last element. `Array(3)` creates three holes;
7979
`Array.of(3)` creates one element containing 3.
8080

81-
The next program adds our Python-to-JavaScript compiler, a browser target and
82-
CPython/client parity, coordinated with Shimify source reduction and pocket-python
83-
assembly. See [the implementation plan](IMPLEMENTATION_PLAN.md). A separately
84-
staged independent interpreter is tracked by pocket-python. v0.1.0
85-
provides the runtime foundation; it does not translate source or execute
86-
JavaScript. Prototypes, descriptors, Date, RegExp, Map/Set, typed arrays, browser
87-
globals and other unlisted APIs remain future work. Development is tracked in
88-
the [issues](https://github.com/outside-labs/Python-JavaScript/issues) and
89-
[Project](https://github.com/orgs/outside-labs/projects/11).
81+
Version 0.2.0 also includes a bounded Python-to-JavaScript compiler: a
82+
[binding-aware front end](docs/compiler-front-end.md), [ES module emitter](docs/compiler-emitter.md),
83+
[local-module compiler](docs/compiler-modules.md), [async profile](docs/compiler-async.md)
84+
and [browser worker/host target](docs/compiler-browser.md). Python parses source
85+
at build time; generated modules and selected helpers execute on the client.
86+
The separate pocket-python interpreter will parse newly entered Python in the browser.
87+
88+
```python
89+
from JavaScript.emitter import compile_source
9090

91-
The development checkout now includes a [binding-aware compiler front end](docs/compiler-front-end.md)
92-
that validates source and produces typed IR. The emitter and [local-module compiler](docs/compiler-modules.md)
93-
produce executable ES modules; browser adapters remain a subsequent milestone.
91+
artifact = compile_source("def count(text):\n return len(text)", filename="counter.py")
92+
# artifact.files contains emitted JavaScript, source map and provenance notice.
93+
```
94+
95+
This alpha supports the explicit [compiler language](docs/compiler-language.md),
96+
not arbitrary Python dependencies or complete ECMAScript. Prototypes, descriptors,
97+
Date, RegExp, Map/Set, typed arrays and unlisted APIs remain future work. See
98+
[0.2.0 release notes](docs/release-0.2.0.md), the [implementation plan](IMPLEMENTATION_PLAN.md),
99+
[issues](https://github.com/outside-labs/Python-JavaScript/issues) and
100+
[Project](https://github.com/orgs/outside-labs/projects/11).
94101

95102
## Development
96103

@@ -105,9 +112,8 @@ when Node is absent locally; CI and release builds require it. Runtime code
105112
needs only Python and the two declared companions. Tests make no external
106113
network requests.
107114

108-
The development [compiler emitter](docs/compiler-emitter.md) produces deterministic
109-
ES modules for the approved single-module Python profile. This API is not part
110-
of the published 0.1.0 distribution.
115+
The [compiler emitter](docs/compiler-emitter.md) produces deterministic
116+
ES modules for the approved single-module Python profile. The compiler APIs are included in the 0.2.0 distribution.
111117

112118
The explicit [async compiler profile](docs/compiler-async.md) adds lazy coroutines,
113119
awaited Promise values, callbacks and context cancellation. The [browser target](docs/compiler-browser.md) adds named DOM controls, callbacks,
@@ -118,4 +124,4 @@ with `uv run python examples/browser_text_metrics.py --output build/browser-text
118124
It uses our emitted modules and helpers in a worker; source parsing remains the
119125
separate independent-interpreter milestone.
120126

121-
The development compiler has a versioned [CPython/Node/browser parity suite](docs/compiler-conformance.md) with typed results, source-map error checks and explicit unsupported boundaries.
127+
The compiler has a versioned [CPython/Node/browser parity suite](docs/compiler-conformance.md) with typed results, source-map error checks and explicit unsupported boundaries.

‎RELEASING.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ token belongs in the repository or workflow.
3131
run the examples/tests, and compare published SHA256 hashes with build artifacts.
3232

3333
Publishing a GitHub release triggers upload; a tag push alone does not. PyPI
34-
versions are immutable. Repository visibility stays private; published artifacts
35-
include package source. No open-source license has been selected for this release.
34+
versions are immutable. The repository is public; published artifacts include the selected package source. No open-source license has been selected; existing provenance notices grant no additional rights.

‎docs/compiler-async.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compiled async profile
22

3-
The development APIs `parse_source`, `compile_source` and `compile_modules`
3+
The 0.2.0 APIs `parse_source`, `compile_source` and `compile_modules`
44
accept `async_enabled=True`. Without it, async syntax remains rejected. Published
55
0.1.0 artifacts predate these compiler APIs. Single-module artifacts identify
66
`python-browser-async/1` and ABI `python-browser-async-esm/1`; local-module artifacts

‎docs/compiler-browser.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Compiled browser target
22

3-
The development checkout provides `JavaScript.browser.compile_browser`. It
3+
Version 0.2.0 provides `JavaScript.browser.compile_browser`. It
44
compiles verified [local source modules](compiler-modules.md), enables the
55
[async profile](compiler-async.md), and records the complete local worker/host
6-
asset closure. It is not included in the published 0.1.0 distribution.
6+
asset closure. It is included in 0.2.0; the published 0.1.0 distribution predates this API.
77

88
The target is `python-browser-modules-host-async/1`, compiler ABI
99
`python-browser-host-esm/1`, using host protocol `pocket-python-host` version 1.
@@ -31,7 +31,7 @@ The builder reads the approved text_metrics corpus, emits selected local modules
3131
source maps/notices, the host/worker/protocol modules, a manifest and a small HTML
3232
entry. It requires a new output directory and preserves existing outputs.
3333
The same computation can be imported under CPython in a separate server entry;
34-
client entrypoints and host adapters are explicit. E2E-01 owns the complete
34+
client entrypoints and host adapters are explicit. The pocket-python shared-application example provides the complete
3535
server/client packaging demonstration.
3636

3737
## Python namespace and entry

‎docs/compiler-conformance.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compiler compatibility matrix: compiler-parity/1
22

3-
The development compiler runs the same approved source corpus under CPython
3+
The 0.2.0 compiler runs the same approved source corpus under CPython
44
3.14.7 and as identical emitted ES modules in Node 24.19.0 and a Chromium module
55
worker. This is a bounded ahead-of-time Python profile. The independent source
66
interpreter is a separate pocket-python implementation. Published 0.1.0 predates

‎docs/compiler-emitter.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Experimental ES module emitter
22

3-
The development checkout exposes `JavaScript.emitter.compile_source`. It
3+
Version 0.2.0 exposes `JavaScript.emitter.compile_source`. It
44
validates source through the python-browser/1 front end, lowers the immutable IR
55
and returns a CompiledArtifact without executing input or writing files. The
66
published 0.1.0 package predates this compiler implementation.
@@ -16,7 +16,7 @@ print(artifact.manifest["application_exports"]) # ['count']
1616
```
1717

1818
`files` is a tuple of immutable OutputFile(path, data, role) values. The caller
19-
can inspect or pass those bytes to the future pocket-python application builder.
19+
can inspect or pass those bytes to the pocket-python 0.2 application builder.
2020
The manifest bytes are separate from their own file/hash closure and can be
2121
saved as PYTHON-JAVASCRIPT.json. Every recorded file has exact size, SHA-256 and
2222
role; imports, notices and selected helper dependencies are explicit. Current
@@ -83,7 +83,7 @@ runtime is embedded. The repository has no declared code license; this notice
8383
does not choose or grant one. Redistribution licensing remains a release decision.
8484

8585
Run `python -m unittest discover -s tests -p 'test_compiler*.py' -v` with the
86-
installed development checkout and Node 24.19.0. Tests compare CPython and emitted
86+
installed package and Node 24.19.0. Tests compare CPython and emitted
8787
Node output/errors/evaluation order, the single-module text_metrics application,
8888
precision/Unicode/tuple/default behavior and an independent Node source-map
8989
consumer. Local modules and async browser capabilities have separate adopted

0 commit comments

Comments
 (0)