-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Wasm TypeScript build #976
Conversation
// NOTE: this import path is replaced with `/web` in the `build/web.js` script. | ||
import type {Client, INodeInfoWrapper, SecretManager} from '@cycraig/iota-client-wasm/node'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the same path alias for the client import too?
Edit: to remove the manual workaround in build/web.js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will absolutely try!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried tsc-alias
with paths
myself yesterday and didn't make much progress, but hopefully I was just missing something obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo for ts-mocha
says it uses tsconfig-paths and to pass --paths
for it to work?
https://github.com/piotrwitek/ts-mocha
Should we use tsconfig-paths
instead? https://npmtrends.com/tsc-alias-vs-tsconfig-paths-vs-tscpaths-vs-tspath
Edit: responded to wrong comment chain, my bad...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that tsconfig-paths
works at runtime, while ts-alias
fixes the paths in the artifacts. So we might actually need to use both 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path
alias works. The import path is a bid weird, but I think it should align with the final package structure. Messing with tsconfig-paths
seems to be unnecessary, build and test works with DID type changes.
Fixed on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for replacing my hacks!
Only nit is having four tsconfig
files.
Then should probably be retargeted to
dev
.
I think it's fine to merge into the Wasm client branch now too.
…ger/identity.rs into chore/improve-ts-build
edcffbe
to
d866c17
Compare
* Split StardustClientExt into StardustIdentityClient/Base traits * Add network checks to StardustClientExt * Add context to example errors, increase faucet timeout * Fix compilation without `iota-client` feature, relax Send restriction * Re-export bee_block as the block module * Add IStardustIdentityClient, IStardustIdentityClientExt interfaces * [WIP] TypeScript client extension attempt * Remove expect, make error messages more verbose * Fix AliasOutput serialization, update example * Move deactivate_did_output to StardustIdentityClient Add allow_empty to StardustDocument::unpack. * Update Wasm bindings * Implement publishDidOutput for Wasm bindings * Clean Wasm ex0_create_did example * Implement deleteDidOutput for Wasm bindings * Add ex1_update_did Wasm example, add examples-stardust directory * Add ex2_resolve_did example for Wasm * Add metadata deactivated field Wasm bindings * Fix input commitment hash calculation for multiple inputs Sort inputs. Add some block validation checks. Fix unlocking logic. Fix consumeAmount, remainderAmount calculations. * Add ex4_delete_did Wasm example * Fix StateMetadataDocument serialised fieldnames Remove timestamps when unpacking an empty DID Document. * Fix dust outputs when reclaiming Alias Output amount * Update iota.js to latest version * Start iota.rs Node.js client intergration * Use unofficia iota-client Wasm bindings * Fix formatting * Add StardustDocument::unpack_from_block, simplify TypeScript * Apply suggestions from code review * Wait for faucet in Wasm Stardust examples * Change TypeScript `import` to `import type` * Improve Wasm TypeScript build (#976) * Remove sleep in Wasm deactivate example * Revert change to txm README.md example Co-authored-by: Eike Haß <eike-hass@web.de>
Description of change
Use tsconfig
paths
to resolve modules from wasm folder. Addedtsc-alias
to then fix the paths for the actual output.Moved and renamed the
tsconfig.node.json
so editors can resolve thepath
configuration.Targeting
feat/wasm-shimmer-client
to reason about the change.Can only be merged after the
DID
type in the bindings is fixed, since the problem leads to build errors.Then should probably be retargeted to
dev
.Type of change
Add an
x
to the boxes that are relevant to your changes.Change checklist
Add an
x
to the boxes that are relevant to your changes.