File tree Expand file tree Collapse file tree 6 files changed +45
-3
lines changed Expand file tree Collapse file tree 6 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 1
1
MONGO_URL = mongodb://localhost:27017/p5js-web-editor
2
2
PORT = 8000
3
- SESSION_SECRET = dyR;Ihp9Y/<i=m9&FUBwV\)$";;G:5a-_G4>W@?r~k$JR$nw74 =#_Cus[z{yBj`Mq:I8LpWE~g{;B,}t\p/`Wjevkb!$n }N];u`Om57NF^GK@z5qF{0L04)Mz6{Djk
3
+ SESSION_SECRET = dyR;Ihp9Y/<i=m9&FUBwV\)$";;G:5a-_G4>W@?r~k$JR$nw74 =#_Cus[z{yBj`Mq:I8LpWE~g{;B,}t\p/`Wjevkb!$n }N];u`Om57NF^GK@z5qF{0L04)Mz6{Djk
4
+ NODE_ENV = development
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { connect } from 'react-redux' ;
3
+ import DevTools from './components/DevTools' ;
3
4
4
5
class App extends React . Component {
5
6
constructor ( props , context ) {
6
7
super ( props , context ) ;
8
+ this . state = { isMounted : false } ;
9
+ }
10
+
11
+ componentDidMount ( ) {
12
+ this . setState ( { isMounted : true } ) ;
7
13
}
8
14
9
15
render ( ) {
16
+ debugger ;
10
17
return (
11
18
< div className = "app" >
19
+ { this . state . isMounted && ! window . devToolsExtension && process . env . NODE_ENV === 'development' && < DevTools /> }
12
20
{ this . props . children }
13
21
</ div >
14
22
) ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { createDevTools } from 'redux-devtools' ;
3
+ import LogMonitor from 'redux-devtools-log-monitor' ;
4
+ import DockMonitor from 'redux-devtools-dock-monitor' ;
5
+
6
+ export default createDevTools (
7
+ < DockMonitor
8
+ toggleVisibilityKey = "ctrl-h"
9
+ changePositionKey = "ctrl-w"
10
+ >
11
+ < LogMonitor />
12
+ </ DockMonitor >
13
+ ) ;
Original file line number Diff line number Diff line change 1
1
import { createStore , applyMiddleware , compose } from 'redux'
2
2
import thunk from 'redux-thunk'
3
+ import DevTools from './modules/App/components/DevTools'
3
4
import rootReducer from './reducers'
4
5
5
6
export default function configureStore ( initialState ) {
7
+
8
+ const enhancers = [
9
+ applyMiddleware ( thunk ) ,
10
+ ] ;
11
+
12
+ if ( process . env . CLIENT && process . env . NODE_ENV === 'development' ) {
13
+ // Enable DevTools only when rendering on client and during development.
14
+ enhancers . push ( window . devToolsExtension ? window . devToolsExtension ( ) : DevTools . instrument ( ) ) ;
15
+ }
16
+
6
17
const store = createStore (
7
18
rootReducer ,
8
19
initialState ,
9
- applyMiddleware ( thunk )
20
+ compose ( ... enhancers )
10
21
)
11
22
12
23
if ( module . hot ) {
Original file line number Diff line number Diff line change 23
23
"css-loader" : " ^0.23.1" ,
24
24
"file-loader" : " ^0.8.5" ,
25
25
"node-sass" : " ^3.7.0" ,
26
+ "redux-devtools" : " ^3.3.1" ,
27
+ "redux-devtools-dock-monitor" : " ^1.1.1" ,
28
+ "redux-devtools-log-monitor" : " ^1.0.11" ,
26
29
"sass-loader" : " ^3.2.0" ,
27
30
"style-loader" : " ^0.13.1" ,
28
31
"webpack" : " ^1.13.0" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ module.exports = {
14
14
extensions : [ '' , '.js' , '.jsx' ] ,
15
15
} ,
16
16
plugins : [
17
- new webpack . HotModuleReplacementPlugin ( )
17
+ new webpack . HotModuleReplacementPlugin ( ) ,
18
+ new webpack . DefinePlugin ( {
19
+ 'process.env' : {
20
+ CLIENT : JSON . stringify ( true ) ,
21
+ 'NODE_ENV' : JSON . stringify ( 'development' ) ,
22
+ }
23
+ } )
18
24
] ,
19
25
module : {
20
26
loaders : [
You can’t perform that action at this time.
0 commit comments