Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Electron Typescript Single Page Apps
1. Single Page Electron Apps in
Typescript
Strongly Typing the Desktop:
Web to Desktop Bridge
2. Why Electron?
* Cross platform development – Be a polyglot developer yet still release
for X-Platform.
* Today you can write .Net Core apps and JS Desktop Applications that can run
on multiple platforms. We’re getting closer to a future where multiple languages
can be used for development. For example, you could code in JS and .Net, and
still deploy Linux, OSX apps.
* Electron gives you consistent, stable API. Chrome is always on the
cutting edge which means you get to code on the latest front-end
technologies (like CSS Grids)
* Electron gives you Node API access (binary streams, IPC).
3. Why Typescript?
Electron uses event-based communication between the main and render
process. During an IPC (inter-process-communication) where data
crosses the process boundary, it’s necessary for both the publisher and
subscriber of the event to conform to the same interface.
In Typescript, we have interfaces to enforce that the render, main process
and also any other process such as a .Net API follow the same signature
(arguments).
5. Electron Process
* Main Process:
- App event listener
- Starts application
- Access to Node Apis
* Render Process
- Handles views
- Where React/Angular takes over
9. Additional Resources
* Awesome Electron
https://github.com/sindresorhus/awesome-electron
(Useful resource for patching and building Electron installers)
* Real world Electron: Building Cross-platform desktop apps with JavaScript
https://youtu.be/YLExGgEnbFY?list=PLz6xH_GrBpquZgdVzEX4Bix0oxHQlZfwm
* Electron Rocks Blog
http://electron.rocks/
* Typewriter: Generate Typescript Declarations from C#
https://github.com/frhagn/Typewriter