Giter Site home page Giter Site logo

piotrwitek / react-redux-typescript-jspm-starter Goto Github PK

View Code? Open in Web Editor NEW
231.0 19.0 43.0 6.47 MB

Futuristic, bundle-free, development environment for building Component-Driven SPA with React, Redux and TypeScript - powered by JSPM (SystemJS & Rollup with tree-shaking)

Home Page: https://piotrwitek.github.io/react-redux-typescript-jspm-starter/

License: MIT License

JavaScript 29.19% TypeScript 62.06% HTML 5.42% Batchfile 0.34% CSS 2.99%
jspm typescript react redux systemjs rollup starter hot-reload boilerplate

react-redux-typescript-jspm-starter's Introduction

React / Redux / TypeScript / JSPM - Starter

based on JSPM (SystemJS - ES module loader + bundling with Rollup)

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)

Learn more about static typing with TypeScript in "React & Redux" apps here:

A comprehensive guide to static typing "React & Redux" apps using TypeScript
https://github.com/piotrwitek/react-redux-typescript-guide

Alternative Webpack-2 powered Starter with react-hot-loader, optimized for performance:

https://github.com/piotrwitek/react-redux-typescript-webpack-starter

Demo:

http://piotrwitek.github.io/react-redux-typescript-jspm-starter/


Table of Contents

  1. Innovations
  2. Features
  3. Roadmap
  4. Installation
  5. Project Structure
  6. Workflows Guide
  7. CLI Commands

Innovations

RAPID-SPEED DEVELOPMENT WORKFLOW - no bundling!

No module bundling during development, instead loading source files (.ts/.tsx) directly in the browser (using plugin-typescript). Type-checking is disabled for speed and delegated to another process.

DELEGATED TYPE-CHECKING

Type-checking is delegated to a seperate process using following options:

  • CLI - TypeScript compiler running in CLI (instructions)
  • Editor/IDE - TypeScript Language Service providing Intellisense (e.g. Webstorm, VS Code, Atom, Sublime Text, alm.tools and more...)

NOTE: There are two seperate tsconfig needed - one for type-checking during development and the other for sources compilation to create production bundle:

STRICT NULL CHECKS

Enable strictNullChecks with noImplicitAny (compiler flags), to get Non-nullable Types (v2.0) and Smarter Type Inference (v2.1) (Source) which greatly increase your TypeScript experience.

HOT-RELOAD THAT SCALE

Local dev-server with hot-reload out-of-the-box (using systemjs-hot-reloader).

Scaling: - this workflow can handle very large projects with thousands of modules without slowing down, basically because it re-import and re-evaluate only those modules that has changed in the browser using SystemJS Module Loader.__

More on differences with Webpack workflow from real project use-case by @jonaskello microsoft/TypeScript#1564 (comment)

CLI WORKFLOW

Most often your team is using different Editors/IDE's so you'll need to have a common way across the team to run type-checking using right version of TypeScript compiler for consistent results and avoid version mismatch issues.

Provided npm commands *(JS emit is disabled to not emit files for type-checking):

  • tsc -p src --watch - fast incremental type-checking in watch mode
  • tsc -p src - single thorough check

ASYNC/AWAIT/GENERATORS - transpilation to ES5

TypeScript natively support "async & generator functions" transformations without any other tools when targeting ES5:

  • Async/Await - TS v2.1 provide native downlevel transformation to ES5 (Source)
  • Generators - TS v2.3 provide native downlevel transformation to ES5 (Source)

TESTING WITH TYPESCRIPT

  • Running tests without transpilation with ts-node runtime (CLI command npm test)
  • Test harness using (jest)
  • Jest Snapshot Testing in TypeScript

AUTOMATIC BUILD SCRIPTS

Fully automatic build script will generate your "vendor bundle" by parsing and extracting JSPM dependencies from package.json. No manual configuration.

OPTIMIZED JSPM LOADING SPEED

When trying to load multiple external dependencies as seperate calls it can slow down page reload in the browsers. Splitting external dependencies to a "vendor bundle" (from node_modules/ dependencies)can speed up page reload significantly by minimizing requests count.

Test reload speed improvement using following simple test procedure:

  1. run npm run dev:unbundle -> open network tab in chrome dev tools -> reload the page -> check logged results
  2. run npm run dev:bundle -> open network tab in chrome dev tools -> reload page -> compare logged results with previous

Features

  • PRODUCTION-WORKFLOW - cross-platform npm scripts for production bundling & deployment, github-hooks, linter, test runner etc.
  • TYPESAFE-API-CALLS - type safety of HTTP API calls (responses/requests) - stop checking for API docs and let your tools guide you
  • REACT-ROUTER - react-router-redux to store routing history in redux state (Time-Travel Debugging)
  • REDUX-DEV-TOOLS - Redux DevTools with chrome-extension
  • BEM & ITCSS - BEM with Inverted Triangle conventions to give meaning and context to CSS classes
  • CSS-MODULES - locally scoped CSS, encapsulated as ES6 Modules (using csjs)

EXAMPLE: Consumer Component and CSS Module in TypeScript

React Best Practices & Optimizations

  • no mixins -> use ES6 style PureRenderMixin with PureComponent
  • no ref strings -> use ref callbacks
  • no method binding -> use ES Class Fields
  • no function/objects instantiation in render method -> instantiate in outer scope and use references
  • render big collections in separate, dedicated components -> no unfortunate re-renders when other props changes
  • don't use array index as key property -> use item unique id property to eliminate bugs
  • remove bindActionCreators boilerplate using object literal with actions instead of mapDispatchToProps function issue #32

React-Redux Patterns

JSPM / System.js / Rollup

  • JSPM 0.17.X - production ready set-up with best-practices from real-world projects
  • optimized loading speed by utilizing vendor dev-bundle (read below)
  • using Rollup for bundling and tree-shaking optimizations
  • bundles for production - seperate vendor & app bundles
  • importing and bundling CSS / SCSS / JSON / Image files using plugins

Roadmap

  • Redux integration testing
  • Testing with Enzyme (JSDOM)
  • Testing with Snapshots

Installation

Prerequisites

  • Node.js >=4.0.0
  • Optional: Global JSPM installation for CLI commands - npm i -g jspm
  • you can use Yarn
// Clone repo
git clone https://github.com/piotrwitek/react-redux-typescript-jspm-starter.git

// Install dependencies
npm install

// Install JSPM packages and create vendor dependencies bundle
npm run init

// Run development server with HMR
npm run dev

Project Structure

.
├── assets                      # static assets copied to dist folder
|   ├── index.html              # index.html configured for production use
|   ├── loader-styles.css       # css app loading indicator
|   └── shim.min.js             # core-js polyfill
├── dist                        # production build output
├── scripts                     # build and workflow scripts
├── src                         # app source code
│   ├── components              # global reusable presentational components
│   ├── containers              # container components providing redux context
│   ├── layouts                 # components defining page layouts
│   ├── services                # modules abstracting communication with web services
│   ├── store                   # modules containing redux modules (reducers/constants/action creators)
│   ├── types                   # custom TypeScript definitions
│   ├── utils                   # app utility modules
│   ├── app.tsx                 # app entry module with routing config
│   └── tsconfig.tsx            # TypeScript compiler config
├── temp                        # development vendor bundle output
├── index.html                  # index.html
├── jspm.config.js              # system.js config for app dependencies
├── server.js                   # dev-server entry module
└── tslint.json                 # linter config

Workflows Guide

NOTE: Use index.html from assets for production, it have optimized loading logic for production. It is already configured in build script.

- Development Workflow

  1. npm run dev:bundle - build optional vendor dependencies bundle to speed-up page reload during development (re-run when dependencies was changed)
  2. npm run dev - start local dev server with hot-reload and open browser

- NO-IDE Workflow - command line type checking

  1. npm run tsc:watch - if you don't use IDE with Intellisense, run this command for fast incremental type-checking in CLI

- Build for Production Workflow

  1. npm run build - create app.js & vendor.js bundles in dist/ folder
  • npm run build:app - build only app.js bundle (run when project source code has changed)
  • npm run build:vendor - build only vendor.js bundle (run when project dependencies has changed)
  1. npm run prod - start local dev server in dist/ folder running production bundle

CLI Commands

- Init

npm run init - install jspm packages and prebuilds vendor.dev.js bundle

- Development

npm run dev or yarn dev - start local dev server with hot-reload jspm-hmr

npm run dev:bundle - build optional vendor dependencies bundle (vendor.dev.js) to speed-up page reload during development (non-minified with source-maps)

npm run dev:unbundle - remove vendor.dev.js bundle package
(WARNING: it will result in loading all of vendor packages as multiple requests - use it only when needed e.g. leveraging HTTP/2 multiplexing/pipelining)

- Type checking

npm run tsc - single thorough check

npm run tsc:watch - fast incremental type-checking in watch mode

- Production Bundling (dist/ folder)

npm run prod - start local dev server in dist/ folder running production bundle

npm run build - build all, app.js & vendor.prod.js bundle

npm run build:app - build only src/ - app.js (minified, no source-maps)

npm run build:vendor - build only node_modules/ dependencies - vendor.prod.js (minified, no source-maps)

npm run build:debug - build debug version of app.js (non-minified with source-maps)

- Utility & Git Hooks

npm run clean - clean dist, node_modules, jspm_packages folders

npm run lint - run ts linter

npm run test - run tests with jest runner

npm run test:update - updates jest snapshots

npm run precommit - pre commit git hook - runs linter and check types

npm run prepush - pre push git hook - runs linter and tests

- Deployment

npm run deploy:init - clone git repository in /dist folder (gh-pages branch)

npm run deploy - commit and push all changes found in /dist folder


The MIT License (MIT)

Copyright (c) 2016 Piotr Witek [email protected] (http://piotrwitek.github.io/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

react-redux-typescript-jspm-starter's People

Contributors

amygdaloideum avatar fa93hws avatar frankwallis avatar jonaskello avatar piotrwitek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-redux-typescript-jspm-starter's Issues

Build task should generate a index.html in dist/

I tried to make it work by copying the base index.html and adapting the scripts urls to the ones in /dist/ but app.js failed to load.

Could you generate the proper html (maybe by "patching" the root index.html?) in addition to the js files?

Unrelated:
Thanks for this repo, that starter kit looks really interesting to me, the dev performance aspect in particular.

cross-platform npm scripts

There are some npm scripts that are using Linux special commands like:
cp command in init:dist, regenerator and post_jspm-bundle-vendor-prod.

This will not work in Windows environment. I had to use Cygwin tool to use linux commands.

We may create nodejs build file (build.js) which would make use of fs, and call it from npm scripts like node ./build --some arguments.

Do you have any idea how we can make it cross-platform.

Add async/await ES5 example with regenerator

It is possible to use async/await transpiled to ES5 with only TypeScript and Regenerator with this setup.
Don't need to add Babel in to workflow.
I'm successfully using it in my commercial closed source project, that's working even for IE 10+, with just Promise polyfill.
I'll add example in next release.
Link to my explanation on TypeScript ES6 Generator support thread:
microsoft/TypeScript#1564 (comment)

rewrite

starting to work on a rewrite as I have iterated on this starter kit with several of my commercial and other open-source projects and came up with new conventions, and best practices

`npm i` fails

> jspm bundle dev-bundle.config.js out/dev-bundle.js -id

     Building the bundle tree for dev-bundle.config.js...

err  TypeError: jspm_packages/github/frankwallis/[email protected]/transpiler.js: (0 , _getIterator3.default) is not a function
    at Parser.loadPlugins (/home/vith/react-ts-jspm-starter-kit/node_modules/babylon/lib/parser/index.js:96:56)
    at new Parser (/home/vith/react-ts-jspm-starter-kit/node_modules/babylon/lib/parser/index.js:58:27)
    at parse (/home/vith/react-ts-jspm-starter-kit/node_modules/babylon/lib/index.js:47:10)
    at File.parse (/home/vith/react-ts-jspm-starter-kit/node_modules/babel-core/lib/transformation/file/index.js:517:34)
    at File.parseCode (/home/vith/react-ts-jspm-starter-kit/node_modules/babel-core/lib/transformation/file/index.js:603:20)
    at /home/vith/react-ts-jspm-starter-kit/node_modules/babel-core/lib/transformation/pipeline.js:49:12
    at File.wrap (/home/vith/react-ts-jspm-starter-kit/node_modules/babel-core/lib/transformation/file/index.js:563:16)
    at Pipeline.transform (/home/vith/react-ts-jspm-starter-kit/node_modules/babel-core/lib/transformation/pipeline.js:47:17)
    at Object.exports.compile (/home/vith/react-ts-jspm-starter-kit/node_modules/systemjs-builder/compilers/compiler.js:22:22)
    at Object.exports.compile (/home/vith/react-ts-jspm-starter-kit/node_modules/systemjs-builder/compilers/register.js:4:19)
    at /home/vith/react-ts-jspm-starter-kit/node_modules/systemjs-builder/lib/compile.js:117:43
    at tryCatcher (/home/vith/react-ts-jspm-starter-kit/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/vith/react-ts-jspm-starter-kit/node_modules/bluebird/js/release/promise.js:504:31)
    at Promise._settlePromise (/home/vith/react-ts-jspm-starter-kit/node_modules/bluebird/js/release/promise.js:561:18)
    at Promise._settlePromiseCtx (/home/vith/react-ts-jspm-starter-kit/node_modules/bluebird/js/release/promise.js:598:10)
    at Async._drainQueue (/home/vith/react-ts-jspm-starter-kit/node_modules/bluebird/js/release/async.js:143:12)

npm ERR! Linux 4.6.5-1-lqx
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "bundle-dev"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] bundle-dev: `jspm bundle dev-bundle.config.js out/dev-bundle.js -id`
npm ERR! Exit status 1

full terminal session

version: v0.7.1-1-gae651fc

Compile TS generators to ES5 without Babel?

Resuming the discussion from here: microsoft/TypeScript#1564 (comment)

I contend that the method below (from the docs of this starter) is not possible, due to the simple reason that it's not possible to compile TS with generators intact to an ES5 target in the first place.

Alternative solution to resolve Generator transformation to ES3/ES5:
My solution prefer using only Facebook Regenerator Project instead of adding Babel as dependency (NOTE: Babel internally is using the same approach, running "regenerator runtime" internally for async and generator functions transformations - https://babeljs.io/docs/usage/caveats/)

When building for production use npm run regenerator CLI command just after a build command to apply transform to app.js bundle, or use an alias command npm run build:regenerator to run it automatically with each build.

Installing behind a proxy

Hi, here's an issue I'm having when I try to install this repo behind a proxy. When I run this script: npm run init, I get these errors:

> [email protected] init 
> jspm install && npm run dev:bundle

     Creating registry cache...

warn Error on locate for github:systemjs/plugin-css, retrying (1).
     Error: connect ECONNREFUSED 192.30.253.113:443
         at Object._errnoException (util.js:1022:11)
         at _exceptionWithHostPort (util.js:1044:20)
         at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

warn Error on locate for github:frankwallis/plugin-typescript, retrying (1).
     Error: connect ECONNREFUSED 192.30.253.113:443
         at Object._errnoException (util.js:1022:11)
         at _exceptionWithHostPort (util.js:1044:20)
         at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

warn Error on locate for github:alexisvincent/systemjs-hot-reloader, retrying (1).
     Error: connect ECONNREFUSED 192.30.253.112:443
         at Object._errnoException (util.js:1022:11)
         at _exceptionWithHostPort (util.js:1044:20)
         at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

err  Error on lookup for npm:tslib
Error: connect ECONNREFUSED 151.101.112.162:443
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)

err  Error looking up npm:tslib.

warn Installation changes not saved.

How can I set up a proxy for installing this please? Is it even possible?

I tried running this but it didn't help: setx HTTPS_PROXY <proxy>

I would like to use superagent

Dear Piotr Witek,

I love your work and I just started using it, I'm trying to add a middleware in redux using superagent to query a remote API server.

How can I add dependencies correctly?

Thanks a lot for your help.

My best regards,

Stefano Benetti

Big CSS-MODULES update WITH TYPED CLASS-NAMES

I've been working on a new feature and today I'm releasing it:
Check it out!

CSS-MODULES WITH TYPED CLASS-NAMES

Own concept to achieve locally scoped CSS styles using csjs with statically typed CSS class-names using TypeScript.

  • Full CSS support with pseudo-classes & media queries, encapsulated in ES6 Modules that can be nicely imported by your UI components.
  • Define interfaces with your CSS classes and you get className property type-checking, solid auto-completion and easy refactoring. You can also add doc comments and auto-generate docs of your styles library for your team and utilize IntelliSense features of your IDE.

EXAMPLE: Consumer Component and it's CSS Module in TypeScript Format with Class-Names Interface

Missing bundle-dev script

"postinstall": "jspm install && npm run bundle-dev"
This runs after install but fails at bundle-dev since there is no such script.

tsc errors

Nice starter kit! I've been looking for something like this for a long time. It looks like it has all the pieces I want, and even a plan to add D3 (version 4, I hope!)

When I clone and do npm install then npm start, it seems to work, but I see the following in my ts compiler console (WebStorm): Error:Error: Parse tsconfig error [{"messageText":"Unknown compiler option 'noImplicitThis'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'noUnusedLocals'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'noUnusedParameters'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'typeRoots'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'lib'.","category":1,"code":5023},{"messageText":"Unknown compiler option 'strictNullChecks'.","category":1,"code":5023}]

I've confirmed that WebStorm is using the locally installed typescript. Am I missing something?

Enable tree-shaking for production bundle

  • Add a build scripts which will override compiler module option to use es2015, so Rollup tree-shaking can do it's job
  • Test if tree-shaking working for production bundle
  • Add relevant section in docs

It's not working with IE

Hi, I'm trying to run this boilerplate. There are two issues:

  1. It's not started after "npm start" (npm ERR! missing script: start), but it's working after "npm run dev"
  2. It's not working with IE 11 - I see endless square in the middle of screen (everything is OK with Google Chrome)

npm run build gives errors

Maybe just on my computer, but I get this on a freshly cloned copy of this repo:

$ npm run build

> [email protected] build C:\temp\react-redux-typescript-starter-kit
> npm run build:app && npm run build:vendor


> [email protected] build:app C:\temp\react-redux-typescript-starter-kit
> npm run _jspm-build-app -- --skip-source-maps --minify


> [email protected] _jspm-build-app C:\temp\react-redux-typescript-starter-kit
> jspm build src/app - bundle-config.vendor.js dist/app.js "--skip-source-maps" "--minify"

module.js:457
    throw err;
    ^

Error: Cannot find module 'C:\Temp\react-redux-typescript-starter-kit\node_modules\jspm\jspm.js'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

Consider systemjs-tools

Hi, great project.

Wanted to let you know about systemjs-tools, which you might find increases dev speed/experience. It's in beta at the moment but pretty stable.

Document how to remove bindActionCreators boilerplate

remove bindActionCreators boilerplate using object literal with actions instead of mapDispatchToProps function

const stateToProps = (storeState: IRootReducer) => ({ 
  currencyRates: storeState.currencyRates, 
  currencyConverter: storeState.currencyConverter 
}); 
 
const actionsToProps = Object.assign({}, currencyConverterActions); 
 
export default connect(stateToProps, actionsToProps)(CurrencyConverterContainer); 

improve test harness setup

Figured out nice mocha setup for TypeScript:

require('dotenv').config();

require('ts-node').register({
  project: './src/',
  // fast: true,
  // ignore: false,
});
    "test": "mocha -r './scripts/test' **/*.spec.ts",

changing repository name - react-redux-typescript-starter-kit

I decided to change repo name to better reflect the coming changes which are restructuring to use Redux as state management.
I believe that Redux nowadays is pretty standard in every application, it's battle tested and I don't see any reason to choose differently in any new React applications.

New name will be react-redux-typescript-starter-kit.

Typescript compile has errors (using the tsc version in the starter kit)

Nice work on the starter kit!

I add a npm script to run the typscript compiler in package.json like this:

{
  "scripts": {
    "tsc": "tsc -p src",
  }
}

Then when I run npm run tsc I get a bunch of compile errors.
There are some things missing in tsconfig.json. I'll try to do a PR to show more what I mean.

Update to React 16

Hi there, and let me first thank you for sharing this, the dev speed really is appreciable.

Back to the point: an update to react v16 could be great, given the improvements it brings.

Question about an alternative architecture without plugin-typescript

What if:

1- You don't use plugin-typescript at all, avoiding any kind of in-browser .ts transpiling.
2- The development tsconfig.json is configured to emit system/ES5 modules to the dist/myapp folder:

    "compilerOptions": {
        "module": "system", 
        "target": "es5",
        "outDir": "../dist/myapp",
    },
    "compileOnSave": true

3- The dist/myapp package is marked in the SystemJS config as having "format" : "system", so it doesn't tries to transpile them.

Then, you compile TS from your IDE or using tsc --watch in another console, and the compilation output will be generated on dist/myapp in system/ES5 format ready for the browser SystemJS consumption.

Is this approach better / faster than in-browser transpiling using plugin-typescript? What do you think? I was thinking of going in this direction until I found this project, as I don't like to transpile in the browser if my IDE is already incrementally compiling it. This approach seems simpler to me, but maybe I'm not seeing some disadvantage.

Sass files

Hi piotrwitek. Just wanted to say thanks for this great project - very helpful.

Would you have any insight into how I could maybe include sass files? So:

import './main-layout.scss!';

instead of:

import './main-layout.css!';

Thanks

Adding React-Router

Hi,
I am following this tutorial here :
https://github.com/reactjs/react-router-tutorial/tree/master/lessons/05-active-links
When I add the following element :

        <Link {...this.props} activeClassName="active"/>

I get this Type Error here :

here is the full code:


import * as React from 'react';
// components imports
import {AppStore, UserData} from '../stores/app-store';
import {UserProfile} from './user-profile';
import { Link } from 'react-router'

interface LocalProps extends React.Props<NavLink> {
}

// App pure component
export class NavLink extends React.Component<LocalProps, AppStore> {
  constructor() {
    super();
    this.state = new AppStore();
  }

  render() {
    return (
      <Link {...this.props} activeClassName="active"/>
    );
  }
}

I have installed react-router using jspm and its typings via typings --ambient

Remove JSPM

The dev speed here is amazing!
But, we already have npm and yarn all around, and the jspm repo is not really active that much...
Can we remove the dep. on jspm?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.