Uh oh!
There was an error while loading. Please reload this page.
Draft: Port demos to TypeScript - #201
Conversation
To work with this version of the demos while hacking on Workbench, you can bind mount it. For example, sudo mount --bind /path/to/cloned/demos /path/to/Worbench |
vixalien
commented
Sep 3, 2024
Currently all the demos are ported 🥳. However, some demos have Now it's time for rebase, and working on other steps. |
a00b394 to
c341532CompareUrtsiSantsi
commented
Oct 31, 2024
@vixalien Why do you use |
vixalien
commented
Oct 31, 2024
Yeah we should use that everywhere. I used the former method when I was getting started on this, since I didn't know the latter was possible. |
UrtsiSantsi
commented
Oct 31, 2024
I'll add a commit tomorrow, if you don't beat me to it. |
c341532 to
e41f55eComparevixalien
commented
Oct 31, 2024
@sonnyp I have been brought to the attention of |
e41f55e to
aeea1bfComparevixalien
commented
Oct 31, 2024
I'm currently working towards enabling strict mode in TS. This will catch more errors, but also makes the code look a bit more complex, because there are more null assertions. @JumpLink you might be interested to look at all the |
UrtsiSantsi
commented
Oct 31, 2024
@vixalien I fixed all the places I could find, that were still not using the generic get_object. But I didn't test it 😅 |
vixalien
commented
Nov 1, 2024
I had already pushed the changes and you force pushed the branch 🙈🙊 |
UrtsiSantsi
commented
Nov 1, 2024
@vixalien I didn't do a force push. According to GitHub I added the commits - "UrtsiSantsi added 12 commits", "UrtsiSantsi added 28 commits", while when you force pushed earlier it is "vixalienforce-pushed the wip/vixalien/typescript branch from e41f55e to aeea1bf". My changes are on top of your changes - you fixed the case where the pattern |
vixalien
commented
Nov 1, 2024
Oh, I see. I actually left out those cases, but I was just being lazy 😆. Thanks! I will need to rebase them so that we have a singular commit for each file. i.e. "port: Camera", "port: Welcome" etc... but don't worry about it. I've also gone and enabled strict mode, which now causes a few more errors to pop in. You can run |
sonnyp
commented
Nov 1, 2024
@vixalien don't worry about commit history, I'll squash everything when merging Individual commits won't be helpful. |
sonnyp
commented
Nov 1, 2024
They should be in Workbench since that's the runtime.
Ditto
👍
This looks interesting for “compiling” ts files before running. But we still need a solution to compile ts files to js for humans. |
Actually we could also use ts-blank-space and simplify process the result with prettier. |
UrtsiSantsi
commented
Nov 2, 2024
I think we should leave java script as a language option:
|
vixalien
commented
Nov 2, 2024
Sure. I'll work on it next. |
sonnyp
commented
Nov 12, 2024
@UrtsiSantsi that's the idea 👍 |
vixalien
commented
Jan 28, 2025
With GJS now supporting sourcemaps, there is no need for |
JumpLink
commented
Mar 6, 2025
Can you still use any help here? |
vixalien
commented
Mar 8, 2025
Not much, really. I'm going to rebase this PR and add types for the other demos. Since you're the types guy, you can check the demos I marked with a warning emoji ( |
Done using `find src/ -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;`included in-tree for now. might need to look for long-lasting solution
4555635 to
bd68229Comparevixalien
commented
Mar 8, 2025
Yeah, I think what's next for this is to figure out how to use these types in Workbench:
|
sonnyp
commented
Mar 8, 2025
Yes 👍
I can take care of that if you like
Did we find a solution to compile to reasonable JavaScript? As in keep variable names and so on |
vixalien
commented
Mar 8, 2025
Not sure. If I remember, you have suggested we use babel in the past. We can also use other build tools such as esbuild, then prettify the output. (esbuild eats empty lines, though) |
sonnyp
commented
Mar 10, 2025
https://babeljs.io/docs/babel-plugin-transform-typescript should do the trick 👍 |
vixalien
commented
Mar 10, 2025
Okay, I would say now the ball is now in your hands |
See also #201 --------- Co-authored-by: Angelo Verlain <geoangercola@gmail.com>
sonnyp
commented
Mar 11, 2025
I have partially merged this e4b515e |
This is my attempt to porting demos from javascript to workbench.
Groundwork
.jsto.ts. I will be running the TypeScript compiler (withtsc) to fix demo files as we go.README.typescript.mdshowing basic instructions on how I generated the typestsconfig.jsonfileworkbench-typesFuture tasks
.tsfilesPorted demos