Skip to content

Commit

Permalink
Added polyfills
Browse files Browse the repository at this point in the history
  • Loading branch information
ufukomer committed Jun 9, 2016
1 parent 39d9b98 commit 2ad683d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/app/redux/modules/stars/stars.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fetch from 'isomorphic-fetch';
import { IStars, IStarsAction } from './stars.model';

/** Action Types */
Expand Down Expand Up @@ -37,7 +36,7 @@ export function starsReducer(state = initialState, action: IStarsAction) {
return state;
}

};
}

/** Async Action Creator */
export function getStars(): Redux.Dispatch {
Expand Down
12 changes: 8 additions & 4 deletions src/client.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import * as e6p from 'es6-promise';
(e6p as any).polyfill();
import 'isomorphic-fetch';

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
Expand All @@ -10,8 +14,8 @@ const store: Redux.Store = configureStore(window.__INITIAL_STATE__);
const history = syncHistoryWithStore(browserHistory, store);

ReactDOM.render(
<Provider store={store}>
<Router history={history} children={routes} />
</Provider>,
document.getElementById('app')
<Provider store={store}>
<Router history={history} children={routes} />
</Provider>,
document.getElementById('app')
);
17 changes: 9 additions & 8 deletions src/server.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
const appConfig = require('../config/main');

import * as e6p from "es6-promise";
import * as e6p from 'es6-promise';
(e6p as any).polyfill();
import 'isomorphic-fetch';

import * as React from 'react';
import * as ReactDOMServer from 'react-dom/server';
import * as ReactRouter from "react-router";
import * as ReactRouter from 'react-router';
const RouterContext = ReactRouter.RouterContext as any;

import { Provider } from 'react-redux';
import { syncHistoryWithStore } from 'react-router-redux';
import { configureStore } from './app/redux/store';
import routes from "./app/routes";
import routes from './app/routes';

import { Html } from './app/containers';
const manifest = require('../build/manifest.json');

const Express = require('express');
const path = require('path');
const compression = require('compression');
const Chalk = require("chalk");
const Chalk = require('chalk');
const favicon = require('serve-favicon');

const store = configureStore();
Expand All @@ -28,12 +29,12 @@ const app = Express();
app.use(compression());
app.use(favicon(path.join(__dirname, '..', 'favicon.ico')));

if (process.env.NODE_ENV == "development") {
if (process.env.NODE_ENV == 'development') {
const webpack = require('webpack');
const webpackConfig = require('../config/webpack/dev');
const webpackCompiler = webpack(webpackConfig);

app.use(require("webpack-dev-middleware")(webpackCompiler, {
app.use(require('webpack-dev-middleware')(webpackCompiler, {
publicPath: webpackConfig.output.publicPath,
stats: { colors: true },
quiet: true,
Expand All @@ -44,10 +45,10 @@ if (process.env.NODE_ENV == "development") {
historyApiFallback: true
}));

app.use(require("webpack-hot-middleware")(webpackCompiler));
app.use(require('webpack-hot-middleware')(webpackCompiler));
}

app.use(favicon(path.resolve("favicon.ico")));
app.use(favicon(path.resolve('favicon.ico')));

app.use('/public', Express['static'](path.join(__dirname, '../build/public')));

Expand Down

0 comments on commit 2ad683d

Please sign in to comment.