Skip to content

Conversation

@itaylor
Copy link
Contributor

@itaylor itaylor commented Oct 8, 2025

This is needed to aide integration with other libraries. For instance, if you want to make a generic function that will make use of an RpcStub, you will need to declare a constraint of Serializable<T>, but you currently can't because Serializable isn't exported.

The woraround is to copy the entire type definition and declare it locally, which works, but this is much simpler.

@kentonv
Copy link
Member

kentonv commented Oct 30, 2025

Makes sense but I wonder if we want to change the name to RpcCompatible before making this public?

After all pass-by-reference types aren't really serialized.

@kentonv
Copy link
Member

kentonv commented Oct 30, 2025

(Sorry for taking so long to look at this -- had a busy month.)

@itaylor
Copy link
Contributor Author

itaylor commented Oct 30, 2025

I agree, Serializable isn't a good name for what this does. RpcCompatible is a better name.

@itaylor
Copy link
Contributor Author

itaylor commented Nov 1, 2025

I've updated the PR to change the name to RpcCompatible

@kentonv
Copy link
Member

kentonv commented Nov 5, 2025

Thanks, I'd love to merge this but it looks like there's now a conflict, can you resolve?

`RpcCompatible` and exports it.

This is needed to aide integration with other libraries. For instance,
if you want to make a generic function that will make use of an RpcStub,
you will need to declare a constraint of `RpcCompatible<T>`, but you
currently can't because RpcCompatible isn't exported.

The woraround is to copy the entire type definition and declare it
locally, which works, but this is much simpler.
@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

🦋 Changeset detected

Latest commit: 35837ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
capnweb Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (itaylor)[https://github.com/itaylor]
@kentonv
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@itaylor
Copy link
Contributor Author

itaylor commented Nov 6, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Nov 6, 2025
@itaylor
Copy link
Contributor Author

itaylor commented Nov 6, 2025

I've rebased this on top of latest main branch

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/capnweb@78

commit: 35837ba

@kentonv kentonv merged commit 8a47045 into cloudflare:main Nov 6, 2025
3 of 4 checks passed
@github-actions github-actions bot mentioned this pull request Nov 6, 2025
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