Open zmb3 opened 2 months ago
AFAIK the idea behind this would be to replace these three imports with some kind of a shim:
Here's what Isaiah said when we were talking about it back in December 2023:
The difficulty with adding type-shims is that those types will always be searched for in
teleport/ironrdp/pkg/ironrdp
, which is generated bywasm-pack
with a.gitignore
that ignores everything (*
).This means that we could check in the types generated in
web/packages/teleport/src/ironrdp/pkg/ironrdp.d.ts
and it will cause e.g.yarn type-check
to pass without needing to build the full wasm module. The problem will arise when that API changes --- we will need to remember togit add --force
those changes. An alternative is that we use this non-upstreamed change inwasm-pack
to avoid that gitignore creation. That could work relatively smoothly, we would then just maintain our own.gitignore
inweb/packages/teleport/src/ironrdp/pkg/
that looks like* !.gitignore !ironrdp.d.ts
Keep in mind that that this was said in the context of removing the need to compile WASM code completely. Back then if you didn't compile WASM stuff, you couldn't really use Connect in dev mode as it'd show type errors from the whole project in an overlay inside the app. This has since been removed after we migrated to Vite.
In the case of a CI step, we don't have to worry about gitignore that much. We can keep the shim in a separate directory. In the CI step, we can move the shim to where the code expects WASM files to be. Devs working on those WASM components would need to remember about updating the shim though, but the CI would remind them about that anyway.
Investigate whether we can remove the WASM build from the UI test workflows. The RDP WASM component should not be needed for the web UI tests, and it currently takes just as long as the full test suite, which means that we could cut test runtime in half by removing this step.