bytecodealliance / bytecodealliance/ComponentizeJS

componetize command does not export wasi:http/incoming-handler

Open
#282 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
391
Forks
53
Avg merge
3d 5h
Merged PRs (30d)
1

Description

I might be just doing something wrong, but here's a simple repro.

test.js
```
addEventListener('fetch', (evt) => {
console.log('fetch-event style request handling');
});
```

world.wit

its empty because all it wants to do is be an http server... (if I went wrong its probably here, I assume we don't have to manually export wasi:http/incoming-handler in our world)

```
package fetch:test;

world ui {
}
```

with jco 1.13

jco componetize handle.js --wit world.wit --out handle.wasm

which yields what I would expect, sands that ability to actually accept an incoing request.

all the other package definitions have been omitted, this is was I see when inspecting the component with the wit vs code extension.

```
package root:component;

world root {
import wasi:io/error@0.2.3;
import wasi:io/poll@0.2.3;
import wasi:io/streams@0.2.3;
import wasi:cli/stdin@0.2.3;
import wasi:cli/stdout@0.2.3;
import wasi:cli/stderr@0.2.3;
import wasi:cli/terminal-input@0.2.3;
import wasi:cli/terminal-output@0.2.3;
import wasi:cli/terminal-stdin@0.2.3;
import wasi:cli/terminal-stdout@0.2.3;
import wasi:cli/terminal-stderr@0.2.3;
import wasi:clocks/monotonic-clock@0.2.3;
import wasi:clocks/wall-clock@0.2.3;
import wasi:filesystem/types@0.2.3;
import wasi:filesystem/preopens@0.2.3;
import wasi:random/random@0.2.3;
import wasi:http/types@0.2.3;
import wasi:http/outgoing-handler@0.2.3;
}
```

most importantly, the component doesn't automatically export wasi:http/outgoing-handler like the big fat

Image

would suggest....

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the test.js and world.wit repro and run the shown jco componentize command. Inspect the generated component's WIT imports and exports, focusing on why wasi:http/incoming-handler is absent. Done means the documented HTTP-server case produces a component exposing the expected incoming-handler interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
build-system, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.