8000 GitHub - micacardillo/etr-kit
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

micacardillo/etr-kit

Repository files navigation

Electron TypeScript React Starter Kit

Getting Started

install nvm UNIX https://github.com/creationix/nvm Windows https://github.com/coreybutler/nvm-windows

nvm install 6.12.0
nvm alias default 6.12.0

Then source or reopen all terminals. npm --version should now return 6.12.0

Now install a recent version of NPM globally.

npm install -g npm@latest

install and config IDE of choice

  • Webstorm
  • Visual Studio Code
  • Atom

download the starter kit

git clone https://github.com/soupala/etr-kit

install the 3rd party packages

npm install

start the app in dev mode

npm run dev

run tests

npm run test
8000

Highlights

  • Automatic transpilation, building, and hot-reloading on file save.
  • Tree shaking
  • Linting (AirBnB styleguide).
  • Prettier auto-code formatting (Atom only)
  • Example unit test with Jest.

NOT YET IMPLEMENTED

  • Prettier auto-code formatting (config and how-to guide for Webstorm and VS Code).
  • State management and middleware examples.
  • Example components and containers written in TypeScript.
  • Debugging.
  • Example E2E tests with NightmareJS.
  • Yeoman-style generators.
  • Example icons in /build.
  • Proxy requests to multiple API endpoints crossing multiple namespaces.
  • Example parallel services automatically spun up as part of dev, prod, and distribution.
  • Pipes and Interfaces between UI and the parallel services.
  • Self-updating distribution (delta applied from tag of Github repo, for example).

Install Devtron

$ npm install --save-dev devtron

// After starting the Electron app in dev mode, run the following from the Console tab:
require('devtron').install() // You should now see a Devtron tab added to the DevTools

Study Topics

STATELESS VERSUS STATEFUL REACT COMPONENTS

Electron is Chrome (Multi-Process Architecture)

link

Main Process Vs. Renderer Process

link

Cross-Process Communication

IPC

REMOTE

  • values must be serializable, meaning must be able to JSON.stringify(value)
  • the built-in remote module is synchronous and may be blocking to the UI until method completes
  • use https://github.com/electron-userland/electron-remote whenever possible
  • modules can be written for consumption in either process

example shared module

const electron = require('electron');
const foo = electron.foo || electron.remote.foo;

// now you can use module in either main or renderer process
console.log(foo);

CPU-Intensive

BUILDING DISTRIBUTABLE APP

  • coming soon

License

See the LICENSE file for license rights and limitations (MIT).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0