Skip to content

Allow referencing empty-object exports as entrypoints. - #1963

Merged
kentonv merged 1 commit into
mainfrom
kenton/empty-handlers
Apr 4, 2024
Merged

Allow referencing empty-object exports as entrypoints.#1963
kentonv merged 1 commit into
mainfrom
kenton/empty-handlers

Conversation

@kentonv

@kentonv kentonv commented Apr 4, 2024

Copy link
Copy Markdown
Member

This fixes a regression in miniflare around named entrypoints: If a script had a top-level export that was an object with no instance properties, miniflare would treat it as a named entrypoint (configuring a socket for it), but workerd would consider this config invalid because the export didn't appear to actually be able to handle events.

It would be hard to make miniflare be able to detect the types of exports, so instead we make workerd more lenient.

This fixes a regression in miniflare around named entrypoints: If a script had a top-level export that was an object with no instance properties, miniflare would treat it as a named entrypoint (configuring a socket for it), but workerd would consider this config invalid because the export didn't appear to actually be able to handle events.

It would be hard to make miniflare be able to detect the types of exports, so instead we make workerd more lenient.
@kentonv
kentonv requested review from a team as code owners April 4, 2024 17:09
@kentonv
kentonv requested review from Warfields and mikea April 4, 2024 17:09
@kentonv
kentonv merged commit 4037068 into main Apr 4, 2024
@kentonv
kentonv deleted the kenton/empty-handlers branch April 4, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants