Open HuakunShen opened 2 weeks ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Thank you for this useful project!
I came across this project and find it useful, but there is no TypeScript example in this repo. I wanted to know how well it works with TypeScript.
I thought it would be beneficial to include a TypeScript example with the package to demonstrate how it works and to enhance the experience with IntelliSense autocompletion.
I included a small TypeScript example I make when trying this package. Also enabled
declarationMap
feature.Enable
declarationMap
intsconfig.json
for better TypeScript DX.Replaced
@rollup/plugin-typescript
withrollup-plugin-typescript2
@rollup/plugin-typescript
had some problem withdeclarationMap
when generated.js
and.d.ts
files are not underdist
directly, but underdist/esm
ordist/umd
.@rollup/plugin-typescript
generates"sources": ["../src/comlink.ts"]
incomlink.d.ts.map
, which is wrong.rollup-plugin-typescript2
generates"sources": ["../../src/comlink.ts"],
Add a TypeScript Example
There is no TypeScript example in the
docs/examples/99-nonworker-examples/iframe-ts
directory. I added one so people can experiment with TypeScript features and type intellisense.