Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack4 migrate #958

Merged
merged 9 commits into from
Oct 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ _Formerly known as choonkending/react-webpack-node_
## Features:
- ~~isomorphic~~ [**universal**](https://medium.com/@ghengeveld/isomorphism-vs-universal-javascript-4b47fb481beb#.4x2t3jlmx) Rendering
- [**Redux**](https://github.com/reactjs/redux) Predictive state containers.
- Server-side rendering with [**React Router**](https://github.com/reactjs/react-router) 2.x. Having server-side rendering allows you to pre-render the initial state of your components when a user (or search engine crawler) requests a page.
- Server-side rendering with [**React Router**](https://github.com/reactjs/react-router) 3.x. Having server-side rendering allows you to pre-render the initial state of your components when a user (or search engine crawler) requests a page.
- Integrating Redux with React Router with ~~Redux Simple Router~~ [React Router Redux](https://github.com/reactjs/react-router-redux)
- Asynchronous Data Fetching on server-side rendering
- Server side authentication + Redirecting for components
- Hot reloading using [**react-transform-hmr**](https://github.com/gaearon/react-transform-hmr)
- Time travel using [**Redux-Devtools Chrome Extension**](https://github.com/zalmoxisus/redux-devtools-extension)
- [**Webpack 2**](https://github.com/webpack/webpack) for both development and production bundles. It's (in my opinion) the best bundler for JS, CSS, LESS, images, and lots more!
- [**Webpack 4**](https://github.com/webpack/webpack) for both development and production bundles. It's (in my opinion) the best bundler for JS, CSS, LESS, images, and lots more!
- [**CSS Modules**](https://github.com/css-modules/css-modules) allows for modular and reusable CSS. Say goodbye to conflicts (most of them) and global scope

- **Unit Testing** with jsdom, mocha, sinon & enzyme
Expand Down
5 changes: 4 additions & 1 deletion app/tests/components/MainSection-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from 'react';
import expect from 'expect';
import { mount } from 'enzyme';
import { mount, configure, } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import MainSection from '../../components/MainSection';
import TopicItem from '../../components/TopicItem';

configure({ adapter: new Adapter() });

const emptyData = [];
const topicItemData = [{
text: '',
Expand Down
11 changes: 7 additions & 4 deletions app/tests/setup.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
require('babel-register') ({
presets: ['es2015', 'react', 'stage-0']
});
var jsdom = require('jsdom').jsdom;
const jsdom = require('jsdom');
const { JSDOM } = jsdom;

var exposedProperties = ['window', 'navigator', 'document'];
const exposedProperties = ['window', 'navigator', 'document'];

global.document = jsdom('<!doctype><html><head></head><body></body></html>', {
const { document } = (new JSDOM('<!doctype><html><head></head><body></body></html>', {
url: 'http://localhost:3001'
});
})).window;

global.document = document;

global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
Expand Down