Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions es6-babel-react-flux-karma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"gulp-eslint": "^1.0.0",
"gulp-if": "^2.0.0",
"gulp-inject": "^3.0.0",
"gulp-jshint": "^1.11.2",
"gulp-notify": "^2.2.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-streamify": "1.0.0",
Expand All @@ -58,8 +57,11 @@
"karma-sourcemap-loader": "^0.3.6",
"karma-webpack": "^1.7.0",
"phantomjs": "^1.9.17",
"react": "^0.13.3",
"react": "^0.14.3",
"ts-loader": "^0.6.0",
"react-addons-test-utils": "^0.14.3",
"react-dom": "^0.14.3",
"ts-loader": "^0.7.1",
"typescript": "^1.6.2",
"webpack": "^1.12.2",
"webpack-notifier": "^1.2.1"
Expand Down
2 changes: 1 addition & 1 deletion es6-babel-react-flux-karma/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react/addons';
import * as React from 'react';
import GreetingStore from '../stores/GreetingStore';
import * as GreetingActions from '../actions/GreetingActions';
import GreetingState from '../types/GreetingState';
Expand Down
2 changes: 1 addition & 1 deletion es6-babel-react-flux-karma/src/components/Greeting.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react/addons';
import * as React from 'react';
import * as GreetingActions from '../actions/GreetingActions';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion es6-babel-react-flux-karma/src/components/WhoToGreet.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react/addons';
import * as React from 'react';
import * as GreetingActions from '../actions/GreetingActions';

interface Props {
Expand Down
6 changes: 4 additions & 2 deletions es6-babel-react-flux-karma/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import './dependencies';
import * as React from 'react/addons';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './components/App';
React; // use React as an expression to prevent React being purged from dependencies as not used directly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would just add an explicit import to react:

import "react";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope Can't find variable: React results

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought React is added to the global scope when you import react..


React.render(<App />, document.getElementById('content'));
ReactDOM.render(<App />, document.getElementById('content'));
2 changes: 2 additions & 0 deletions es6-babel-react-flux-karma/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"filesGlob": [
"../typings/**/*.*.ts",
"!../typings/jasmine/jasmine.d.ts",
"!../typings/react/react-addons-test-utils.d.ts",
"**/*.{ts,tsx}"
],
"compilerOptions": {
Expand All @@ -16,6 +17,7 @@
"files": [
"../typings/flux/flux.d.ts",
"../typings/node/node.d.ts",
"../typings/react/react-dom.d.ts",
"../typings/react/react.d.ts",
"../typings/tsd.d.ts",
"actions/GreetingActions.ts",
Expand Down
6 changes: 3 additions & 3 deletions es6-babel-react-flux-karma/test/components/App.tests.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react/addons';
import * as React from 'react';
import * as TestUtils from 'react-addons-test-utils';
import App from '../../src/components/App';
import WhoToGreet from '../../src/components/WhoToGreet';
import Greeting from '../../src/components/Greeting';
import GreetingStore from '../../src/stores/GreetingStore';

const { TestUtils } = React.addons;
React; // use React as an expression to prevent React being purged from dependencies as not used directly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would just add an explicit import to react:

import "react";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope Can't find variable: React results

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnnyreilly with microsoft/TypeScript#6290, this should not be needed now. the React import should be preserved regardless. do you want to send a PR for it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet - yes will do @mhegazy


describe('App', () => {
it('renders expected HTML', () => {
Expand Down
6 changes: 3 additions & 3 deletions es6-babel-react-flux-karma/test/components/Greeting.tests.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react/addons';
import * as React from 'react';
import * as TestUtils from 'react-addons-test-utils';
import Greeting from '../../src/components/Greeting';
import * as GreetingActions from '../../src/actions/GreetingActions';

const { TestUtils } = React.addons;
React; // use React as an expression to prevent React being purged from dependencies as not used directly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import "react";

instead ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope Can't find variable: React results


describe('Greeting', () => {
let handleSelectionChangeSpy: jasmine.Spy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react/addons';
import * as React from 'react';
import * as TestUtils from 'react-addons-test-utils';
import WhoToGreet from '../../src/components/WhoToGreet';
import * as GreetingActions from '../../src/actions/GreetingActions';

const { TestUtils } = React.addons;
React; // use React as an expression to prevent React being purged from dependencies as not used directly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope Can't find variable: React results


describe('WhoToGreet', () => {
let handleSelectionChangeSpy: jasmine.Spy;
Expand Down
2 changes: 2 additions & 0 deletions es6-babel-react-flux-karma/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"../typings/flux/flux.d.ts",
"../typings/jasmine/jasmine.d.ts",
"../typings/node/node.d.ts",
"../typings/react/react-addons-test-utils.d.ts",
"../typings/react/react-dom.d.ts",
"../typings/react/react.d.ts",
"../typings/tsd.d.ts"
],
Expand Down
16 changes: 11 additions & 5 deletions es6-babel-react-flux-karma/tsd.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@
"bundle": "typings/tsd.d.ts",
"installed": {
"jasmine/jasmine.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
"commit": "fa04c80f4a889613b96cb4f283848c61a9f64233"
},
"flux/flux.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
"commit": "fa04c80f4a889613b96cb4f283848c61a9f64233"
},
"node/node.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
"commit": "fa04c80f4a889613b96cb4f283848c61a9f64233"
},
"react/react.d.ts": {
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
}
"commit": "fa04c80f4a889613b96cb4f283848c61a9f64233"
},
"react/react-dom.d.ts": {
"commit": "fa04c80f4a889613b96cb4f283848c61a9f64233"
},
"react/react-addons-test-utils.d.ts": {
"commit": "fa04c80f4a889613b96cb4f283848c61a9f64233"
}
}
}
2 changes: 1 addition & 1 deletion es6-babel-react-flux-karma/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
entry: {
main: './src/main.tsx',
vendor: [
'react/addons',
'react',
'flux',
'events',
'babel/polyfill'
Expand Down