You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ##### Futuristic, bundle-free development environment for building _Component-Driven SPA with React, Redux and TypeScript_ - utilizing power of Static Type-checking, ES.Next, CSS-Modules, Hot-reload, in-browser transpilation, tree-shaking - powered by JSPM (SystemJS & Rollup with tree-shaking).
4
+
> ##### Futuristic, bundle-free development environment for building _Component-Driven SPA with React, Redux and TypeScript_ - utilizing power of Static Type-checking, ES.Next, CSS-Modules, Hot-reload, in-browser transpilation, tree-shaking - powered by JSPM (SystemJS & Rollup with tree-shaking)
### - RAPID-SPEED DEVELOPMENT WORKFLOW - no bundling!
24
27
No bundling during development, instead loading source files (.ts/.tsx) directly in the browser (using [plugin-typescript](https://github.com/frankwallis/plugin-typescript)).
25
-
When file changes - skipping type-checking (which is delegated to seperate process) and reloading only the changed file with hot-reload.
28
+
When file changes - skipping type-checking (which is delegated to seperate process) and reloading only the changed file with hot-reload
26
29
27
30
### - DELEGATED TYPE-CHECKING
28
31
Type-checking is delegated to a seperate process using following options:
@@ -35,20 +38,20 @@ __NOTE:__ There are two seperate __tsconfig__ - one for type-checking during dev
35
38
36
39
[tsconfig for building production bundle](https://github.com/piotrwitek/react-redux-typescript-starter-kit/blob/a00c1b5854c36ea4d31fa1255ce920134bfc3855/jspm.config.js#L129)
37
40
41
+
### - STRICT NULL CHECKS - Enabled
42
+
Enabled strictNullChecks with noImplicitAny tsc flags, to increase type safety and grant better tooling support using Non-nullable Types (v2.0) and Smarter Type Inference (v2.1) [Source](https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/)
43
+
38
44
### - HOT-RELOAD THAT SCALE
39
45
Local dev server with hot-reloading out-of-the-box (using [systemjs-hot-reloader](https://github.com/capaj/systemjs-hot-reloader)).
40
-
__How:__ Loading each module separately and using SystemJS module registry, on changes it's removing old module from registry and re-importing updated one then re-evaluating only those modules that was importing the changed module.
46
+
__How:__ Loading each module separately and using SystemJS module registry, on changes it's removing old module from registry and re-importing updated one then re-evaluating only those modules that was importing the changed module
41
47
42
-
__Scale well with increasing modules count because you reload only modules that has changed.__
48
+
__Great scaling capability with increasing module count because you reload single module files that has changed without rebuilding anything.__
43
49
> __Differences with Webpack workflow explained__ from real project perspective by [@jonaskello](https://github.com/jonaskello)https://github.com/Microsoft/TypeScript/issues/1564#issuecomment-252903932
44
50
45
51
### - CLI WORKFLOW
46
52
Most often your team is using different Editors/IDE's so you'll need to have a common way to run type-checking using a specific version of TypeScript compiler for consistent results and avoid Editor specific issues.
47
53
Run `tsc -p src --watch` command for quick incremental type-checking or `tsc -p src` command for one-time complete check (JS emit is disabled to not clutter your project with intermediate JS files)
48
54
49
-
### - STRICT NULL CHECKS - Enabled
50
-
Enabled strictNullChecks with noImplicitAny tsc flags, to increase type safety and grant better tooling support using Non-nullable Types (v2.0) and Smarter Type Inference (v2.1) [Source](https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/)
51
-
52
55
### - ASYNC/AWAIT/GENERATORS transformation when targeting ES5 (No Babel)
53
56
Support for "async & generator functions" when targeting ES5 __without Babel!__
54
57
- Async/Await - TypeScript v2.1 provide native support for ES5 transformation (https://github.com/Microsoft/TypeScript/pull/9175)
@@ -59,7 +62,11 @@ __Until then use an alternative solution covered below:__
59
62
60
63
[Facebook Regenerator Project](https://github.com/facebook/regenerator) instead of __Babel__ to transform Generator Functions. _(NOTE: Internally **Babel** is also running "regenerator runtime" for async and generator functions transformations - https://babeljs.io/docs/usage/caveats/)_
61
64
62
-
> When building for production use `npm run regenerator` command after completion of build step, this will run "regenerator" on app.js bundle. Alternatively use `npm run build:regenerator` command to automatically run "regenerator" with each production build.
65
+
> When building for production use `npm run regenerator` command after completion of build step, this will run "regenerator" on app.js bundle. Alternatively use `npm run build:regenerator` command to automatically run "regenerator" with each production build
66
+
67
+
### - TESTING WITH TYPESCRIPT
68
+
- Writing and running tests in TypeScript runtime using source files, abstracting complicated setups and transpilation complexity (use `npm test` CLI command)
69
+
- Test harness using [jest](https://github.com/facebook/jest)
63
70
64
71
### - CSS-MODULES WITH TYPED CLASS-NAMES EXPERIMENT
65
72
Locally scoped CSS styles, encapsulated as ES6 Modules that can be imported in UI components, with capability to type-check CSS class-names in your components using interfaces and leverage TypeScript IntelliSense features in Editor/IDE (using [csjs](https://github.com/rtsao/csjs#faq)):
To speed up a full page reload by minimizing request count it is possible to create a development "vendor bundle" for external dependencies loaded from node_modules.
75
-
If not leveraging HTTP/2, it is a best practice to bundle all external dependencies together and load as a one bundle.
82
+
If not leveraging HTTP/2, it is a best practice to bundle all external dependencies together and load as a one bundle
76
83
77
84
Test reload speed improvement using this simple test procedure:
78
85
1. run `npm run unbundle` -> open network tab in chrome dev tools -> reload the page -> check logged results
@@ -82,14 +89,12 @@ Test reload speed improvement using this simple test procedure:
82
89
83
90
## Features
84
91
85
-
- PRODUCTION-WORKFLOW - npm scripts for production bundling & deployment, github-hooks, linter, test runner etc.
92
+
- PRODUCTION-WORKFLOW - cross-platform npm scripts for production bundling & deployment, github-hooks, linter, test runner etc.
86
93
- TYPESAFE-API-CALLS - type checking contracts of REST API calls - forget constantly checking for API docs and let your IDE guide you
87
94
- REACT-ROUTER - included `react-router-redux` to store your routing in state for Time-Travel capabilities
88
95
- REDUX-DEV-TOOLS - installed Redux DevTools capabilities with [chrome-extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd)
89
96
- IMMUTABLE-STORE - using `seamless-immutable` for simplicity and backwards-compatibility with vanilla JS (no hassle with `toJS()`, `get()`, `getIn()` in your containers and components)
90
97
- BEM & ITCSS - using BEM with Inverted Triangle conventions to give meaning and context to CSS classes
91
-
- TESTING IN TYPESCRIPT - writing and running tests from TypeScript source files without transpilation complexity (use `npm test` CLI command) - test harness using [tape](https://github.com/substack/tape) and [blue-tape](https://github.com/spion/blue-tape).
92
-
- Type-safe React-Redux with TypeScript
93
98
94
99
#### React Best Practices & Optimizations
95
100
- no mixins -> use ES6 style PureRenderMixin with PureComponent
@@ -140,12 +145,11 @@ Test reload speed improvement using this simple test procedure:
140
145
│ ├── components # global reusable presentational components
0 commit comments