Skip to content

Commit

Permalink
Compatibility fix for react-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting-Yu Lin committed Oct 3, 2017
1 parent ccb1b3c commit 5a50065
Show file tree
Hide file tree
Showing 22 changed files with 6,905 additions and 31 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/node_modules
build/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules/
# Generated
dist/
coverage/
build/

# Misc
npm-debug.log
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
examples/
test/
coverage/
src/
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 5.1.2

Compatibility fix for `create-react-app` and `react-scripts`

The NPM package `cycle-react` now contains transpiled code that built
by Babel. This fixes `react-scripts build`'s compatibility issue with
ES6.

The underlying component class has been changed from `PureComponent`
to `Component`, due to implementation of `shouldComponentUpdate` raises
warning message for `PureComponent`.

## 5.0.0

Breaking change: Custom events is now subscribed only when listener
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
[![Build Status](https://travis-ci.org/pH200/cycle-react.svg?branch=master)](https://travis-ci.org/pH200/cycle-react)

An [RxJS](https://github.com/Reactive-Extensions/RxJS) functional interface
to [Facebook's React](http://facebook.github.io/react/).
to [Facebook's React](https://reactjs.org/).

Cycle-React allows users to write [React](https://github.com/facebook/react)
applications in functional style and represents their UIs as Observables.
In addition, Cycle-React is immutable and
[optimizes](https://facebook.github.io/react/docs/react-api.html#react.purecomponent)
[optimizes](https://reactjs.org/docs/optimizing-performance.html#avoid-reconciliation)
the component updates internally by default.

Additionally, Cycle-React is also a React-style implementation of a beautiful
Expand Down
2 changes: 1 addition & 1 deletion examples/web/isomorphic/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
let Cycle = require('../../');
let Cycle = require('../../src');
let React = require('react');

let Menu = Cycle.component('Menu', function (_, props) {
Expand Down
2 changes: 1 addition & 1 deletion examples/web/isomorphic/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
let Cycle = require('../../');
let Cycle = require('../../src');
let React = require('react');
let ReactDOM = require('react-dom');
let {App} = require('./app');
Expand Down
2 changes: 1 addition & 1 deletion examples/web/isomorphic/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
let Cycle = require('../../');
let Cycle = require('../../src');
let React = require('react');
let ReactDOMServer = require('react-dom/server');
let express = require('express');
Expand Down
2 changes: 1 addition & 1 deletion examples/web/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function compileExample(exampleName, examplePath) {

var exampleStream = browserify()
.transform(envify({NODE_ENV: 'production'}))
.transform('babelify', {presets: ["es2015", "react"]})
.transform('babelify', {presets: ["env", "react"]})
.require(cyclePath, {expose: 'cycle-react'})
.add(examplePath)
.bundle();
Expand Down
2 changes: 1 addition & 1 deletion examples/web/todomvc/todo-intent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let ESC_KEY = 27;
function todoIntent(interactions) {
return {
changeRoute$: Rx.Observable.fromEvent(window, 'hashchange')
.map(ev => ev.newURL.match(/\#[^\#]*$/)[0].replace('#', ''))
.map(ev => ev.newURL.match(/#[^#]*$/)[0].replace('#', ''))
.startWith(window.location.hash.replace('#', '')),
changeInput$: interactions.get('onInputChange')
.map(ev => ev.target.value),
Expand Down
12 changes: 6 additions & 6 deletions native.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const createComponent = require('./src/component');
const createTemplateComponent = require('./src/template-component');
const createAdapter = require('./src/rx/adapter');
const React = require('react-native');
var createComponent = require('./build/component');
var createTemplateComponent = require('./build/template-component');
var createAdapter = require('./build/rx/adapter');
var React = require('react-native');

const RxAdapter = createAdapter();
var RxAdapter = createAdapter();

const Cycle = {
var Cycle = {
/**
* The component's definition function.
*
Expand Down
Loading

0 comments on commit 5a50065

Please sign in to comment.