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
feat: enable JavaScript components in CI environment
JavaScript WebAssembly components using the jco (JavaScript Component Object)
toolchain are now fully functional in both local development and CI environments.
This resolves GitHub issue #22 by fixing the root cause of ES6 module resolution
limitations in componentize-js and incorrect interface export structures.
Key Changes:
- Fix JavaScript component module resolution by avoiding ES6 imports during
componentization phase and inlining dependencies instead
- Correct interface exports to match WIT world definitions:
* hello_js_component exports `hello` interface per hello-world WIT
* calc_js_component exports `calc` interface per calculator WIT
- Update jco rule to use relative paths for proper ES6 module resolution
- Enable all JavaScript components in both Linux and macOS CI builds
- Add JavaScript component tests to CI test suite
- Remove previous exclusions for broken JavaScript components
Technical Details:
The jco toolchain's underlying componentize-js has limitations with ES6 imports
during the WebAssembly componentization phase. The solution involves:
1. Inlining module dependencies instead of using import statements
2. Exporting interfaces as objects that match WIT world structure
3. Using relative paths in the jco build system for proper module resolution
All three JavaScript components now build successfully:
- simple_js_component (already working - no imports)
- hello_js_component (fixed - inlined formatMessage function)
- calc_js_component (fixed - removed type imports, added calc interface)
The CI environment already had proper Node.js v18 setup via GitHub Actions.
The issue was purely architectural in how JavaScript modules were structured
for WebAssembly componentization.
Closes: #22
0 commit comments