Skip to content

Conversation

@ketanhwr
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

@ketanhwr ketanhwr force-pushed the ketan/dyworker-noname branch from 2568333 to df2bb8e Compare November 25, 2025 11:50
@ketanhwr ketanhwr marked this pull request as ready for review November 25, 2025 12:11
@ketanhwr ketanhwr requested review from a team as code owners November 25, 2025 12:11
assert.strictEqual(loadCount, 5);
// Test that null/undefined name parameter creates unique isolates each time
// Each call should generate a unique name internally.
let noName1 = env.loader.get(null, loadCodeCallback).getEntrypoint();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore this, but what about allowing env.loader.get(loadCodeCallback).getEntrypoint()?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version of this PR reversed the ordering of the params to make the param optional, but that was a breaking change.

But we could, perhaps, create an "overloaded" interface, which accepts either (id, func) or (func). But overloads are kind of awkward.

And actually, if you think about it, when the ID is null, then there's no need for a callback. The callback will always be called, so instead we should just let you pass in the worker definition instead of a callback.

So maybe what we really want is a new method like: load(code)

Which is logically equivalent to: get(null, () => code)

Either way I think passing null to get() should be supported. But probably we want to add this new load() method as well.

@ketanhwr
Copy link
Member Author

ketanhwr commented Nov 27, 2025

Oops, looks like the one-off ephemeral isolates aren't behaving well with asan
*** Fatal uncaught kj::Exception: workerd/server/server.c++:302: failed: expected !service.value->isShared(); service still has references after unlinking; service.key = worker-loader-test. Let me see

Should be fixed now

@ketanhwr ketanhwr force-pushed the ketan/dyworker-noname branch from 3e034c3 to 72b9bbf Compare November 27, 2025 23:31
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.

3 participants