Open up Input for custom extensions. - #34
Merged
Merged
Conversation
tanishiking
approved these changes
Apr 22, 2026
tanishiking
left a comment
Member
There was a problem hiding this comment.
Thanks, I could locally confirm we can implement scala-js-env-wasmtime that defines custom final case class WasmComponent(component: Path) extends Input, and use that Input downstream 👍
LGTM from my side.
tanishiking
added a commit
to scala-wasm/scala-wasm
that referenced
this pull request
Apr 23, 2026
Contributor
I can see one reason: Allowing third party libraries to extend |
gzm0
reviewed
May 2, 2026
gzm0
left a comment
Contributor
There was a problem hiding this comment.
Just a simplification in the test.
Comment on lines
+190
to
+193
| if (withCom) | ||
| kit.startWithCom(Seq(input)) | ||
| else | ||
| kit.start(Seq(input)) |
Contributor
There was a problem hiding this comment.
Suggested change
| if (withCom) | |
| kit.startWithCom(Seq(input)) | |
| else | |
| kit.start(Seq(input)) | |
| withRun(Seq(input))(identity) |
gzm0
approved these changes
May 2, 2026
It was always meant to be extended in the future. The constructor was private, though, which prevent third-parties from extending it. There is no real reason to prevent that, so we actually open it up. We explicitly validate that `JSEnv`s throw an `UnsupportedInputException` for `Input`s that they cannot handle, with a new test in the test kit. They were already supposed to do that, but we could not test it before because the tests themselves could not create an unknown `Input`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was always meant to be extended in the future. The constructor was private, though, which prevent third-parties from extending it. There is no real reason to prevent that, so we actually open it up.
We explicitly validate that
JSEnvs throw anUnsupportedInputExceptionforInputs that they cannot handle, with a new test in the test kit. They were already supposed to do that, but we could not test it before because the tests themselves could not create an unknownInput./cc @tanishiking
With this extension, we will be able to experiment with Wasm inputs in separate repos, until we nail down their semantics for eventual standardization here.