tauri-docs icon indicating copy to clipboard operation
tauri-docs copied to clipboard

Add guide: Typescript

Open JonasKruckenberg opened this issue 3 years ago • 3 comments

TODO

Add a document to getting-started explaining how to set up typescript with Tauri, what the benefits are, and explain a few recommended settings.

Details

  • what (short explainer, link to docs)
  • why (security, DX)

Recommended compiler options

    "target": "ES2021",
    "module": "ESNext",
    "moduleResolution": "Node",
    "strict": true,
    "isolatedModules": true,
    "forceConsistentCasingInFileNames": true,

JonasKruckenberg avatar Feb 14 '22 11:02 JonasKruckenberg

I am semi-interested in the TypeScript guide stuff, not sure if I have enough knowledge to really fully fill it out. I am curious about the target in the OP being ES2021, isn't Tauri mostly 2017+ regarding system versions?

chippers avatar Feb 14 '22 12:02 chippers

We did a few tests a while ago, I don't remember the details but we determined ES2021 is fine for user code, but tauri libs and plugins have to target ES2019(?) because of webpack 4.

JonasKruckenberg avatar Feb 14 '22 13:02 JonasKruckenberg

Not sure where to cover this 🤔 But regardless will track it for 2.0 as information we want covered one way or another.

simonhyll avatar Sep 15 '23 21:09 simonhyll