Skip to content
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

Add typescript support #7

Closed
wants to merge 1 commit into from
Closed

Add typescript support #7

wants to merge 1 commit into from

Conversation

alexcasalboni
Copy link
Contributor

Not sure if this fits here or if we should have its own repo 🤔

Thoughts?

@alexcasalboni
Copy link
Contributor Author

Also, @Jer1605 any suggestions to make that code more TS-friendly? I've only converted the typing from the JS implementation, but I'm sure that a native TypeScript implementation would look quite different :)

@@ -5,11 +5,13 @@
"types": "./types/wit.d.ts",
"scripts": {
"build": "npx @bytecodealliance/jco componentize src/index.js --wit wit -o example-js-component.wasm -n data-collection -d all",
"build-typescript": "npx tsc & npx @bytecodealliance/jco componentize src/typescript/index.js --wit wit -o example-js-component.wasm -n data-collection -d all",
Copy link
Contributor

Choose a reason for hiding this comment

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

just for that i think its own repo is a good idea :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I had to create another folder because tsc by default compiles index.ts into index.js (overwriting the existing JS file). And then the build script needs the additional tsc step to generate the .js file, so it can't be 100% identical either.

I'd also agree this is enough to justify splitting to its own repo 👍

Copy link

Choose a reason for hiding this comment

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

@alexcasalboni, I'd definitely recommend splitting TypeScript into its own repo. Mixing JS and TS adds extra build steps and potential conflicts (like overwriting issues), plus not everyone uses TS. Keeping them separate makes things cleaner, easier to maintain, and avoids unnecessary complexity. Sounds like a win-win ;)

@alexcasalboni
Copy link
Contributor Author

Closing, in favor of edgee-cloud/example-ts-component#1

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