@@ -16,9 +16,9 @@ return /******/ (function(modules) { // webpackBootstrap
16
16
/******/ function __webpack_require__ ( moduleId ) {
17
17
/******/
18
18
/******/ // Check if module is in cache
19
- /******/ if ( installedModules [ moduleId ] )
19
+ /******/ if ( installedModules [ moduleId ] ) {
20
20
/******/ return installedModules [ moduleId ] . exports ;
21
- /******/
21
+ /******/ }
22
22
/******/ // Create a new module (and put it into the cache)
23
23
/******/ var module = installedModules [ moduleId ] = {
24
24
/******/ i : moduleId ,
@@ -43,9 +43,6 @@ return /******/ (function(modules) { // webpackBootstrap
43
43
/******/ // expose the module cache
44
44
/******/ __webpack_require__ . c = installedModules ;
45
45
/******/
46
- /******/ // identity function for calling harmony imports with the correct context
47
- /******/ __webpack_require__ . i = function ( value ) { return value ; } ;
48
- /******/
49
46
/******/ // define getter function for harmony exports
50
47
/******/ __webpack_require__ . d = function ( exports , name , getter ) {
51
48
/******/ if ( ! __webpack_require__ . o ( exports , name ) ) {
@@ -73,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap
73
70
/******/ __webpack_require__ . p = "" ;
74
71
/******/
75
72
/******/ // Load entry module and return exports
76
- /******/ return __webpack_require__ ( __webpack_require__ . s = 1 ) ;
73
+ /******/ return __webpack_require__ ( __webpack_require__ . s = 0 ) ;
77
74
/******/ } )
78
75
/************************************************************************/
79
76
/******/ ( [
@@ -83,6 +80,35 @@ return /******/ (function(modules) { // webpackBootstrap
83
80
"use strict" ;
84
81
85
82
83
+ Object . defineProperty ( exports , "__esModule" , {
84
+ value : true
85
+ } ) ;
86
+ exports . default = asyncBootstrapper ;
87
+
88
+ var _reactTreeWalker = __webpack_require__ ( 1 ) ;
89
+
90
+ var _reactTreeWalker2 = _interopRequireDefault ( _reactTreeWalker ) ;
91
+
92
+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
93
+
94
+ function asyncBootstrapper ( app , options ) {
95
+ var visitor = function visitor ( element , instance ) {
96
+ if ( instance && typeof instance . asyncBootstrap === 'function' ) {
97
+ return instance . asyncBootstrap ( ) ;
98
+ }
99
+ return true ;
100
+ } ;
101
+
102
+ return ( 0 , _reactTreeWalker2 . default ) ( app , visitor , { } , options ) ;
103
+ }
104
+
105
+ /***/ } ) ,
106
+ /* 1 */
107
+ /***/ ( function ( module , exports , __webpack_require__ ) {
108
+
109
+ "use strict" ;
110
+
111
+
86
112
Object . defineProperty ( exports , "__esModule" , {
87
113
value : true
88
114
} ) ;
@@ -93,11 +119,10 @@ var _react = __webpack_require__(2);
93
119
94
120
var defaultOptions = {
95
121
componentWillUnmount : false
96
- } ;
97
122
98
- // Lifted from https://github.com/sindresorhus/p-reduce
99
- // Thanks @sindresorhus !
100
- /* eslint-disable no-console */
123
+ // Lifted from https://github.com/sindresorhus/p-reduce
124
+ // Thanks @sindresorhus !
125
+ } ; /* eslint-disable no-console */
101
126
102
127
// Inspired by the awesome work done by the Apollo team.
103
128
// See https://github.com/apollostack/react-apollo/blob/master/src/server.ts
@@ -152,7 +177,7 @@ function reactTreeWalker(element, visitor, context) {
152
177
var options = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : defaultOptions ;
153
178
154
179
return new Promise ( function ( resolve ) {
155
- var doVisit = function doVisit ( getChildren , visitorResult , childContext , isChildren ) {
180
+ var doVisit = function doVisit ( getChildren , visitorResult , childContext ) {
156
181
var doTraverse = function doTraverse ( shouldContinue ) {
157
182
if ( ! shouldContinue ) {
158
183
// We recieved a false, which indicates a desire to stop traversal.
@@ -165,19 +190,19 @@ function reactTreeWalker(element, visitor, context) {
165
190
if ( child == null ) {
166
191
// If no children then we can't traverse. We've reached the leaf.
167
192
resolve ( ) ;
168
- } else if ( isChildren ) {
193
+ } else if ( _react . Children . count ( child ) ) {
169
194
// If its a react Children collection we need to breadth-first
170
195
// traverse each of them.
171
196
var mapper = function mapper ( aChild ) {
172
- return aChild ? reactTreeWalker ( aChild , visitor , theChildContext ) : undefined ;
197
+ return aChild ? reactTreeWalker ( aChild , visitor , theChildContext , options ) : undefined ;
173
198
} ;
174
199
// pMapSeries allows us to do depth-first traversal. Thanks @sindresorhus!
175
200
pMapSeries ( _react . Children . map ( child , function ( cur ) {
176
201
return cur ;
177
202
} ) , mapper ) . then ( resolve ) ;
178
203
} else {
179
204
// Otherwise we pass the individual child to the next recursion.
180
- reactTreeWalker ( child , visitor , theChildContext ) . then ( resolve ) ;
205
+ reactTreeWalker ( child , visitor , theChildContext , options ) . then ( resolve ) ;
181
206
}
182
207
} ;
183
208
@@ -261,7 +286,7 @@ function reactTreeWalker(element, visitor, context) {
261
286
// This must be a basic element, such as a string or dom node.
262
287
doVisit ( function ( ) {
263
288
return element . props && element . props . children ? element . props . children : undefined ;
264
- } , visitor ( element , null , context ) , context , true ) ;
289
+ } , visitor ( element , null , context ) , context ) ;
265
290
}
266
291
} ) . catch ( function ( err ) {
267
292
// We don't want errors to be swallowed!
@@ -270,35 +295,6 @@ function reactTreeWalker(element, visitor, context) {
270
295
} ) ;
271
296
}
272
297
273
- /***/ } ) ,
274
- /* 1 */
275
- /***/ ( function ( module , exports , __webpack_require__ ) {
276
-
277
- "use strict" ;
278
-
279
-
280
- Object . defineProperty ( exports , "__esModule" , {
281
- value : true
282
- } ) ;
283
- exports . default = asyncBootstrapper ;
284
-
285
- var _reactTreeWalker = __webpack_require__ ( 0 ) ;
286
-
287
- var _reactTreeWalker2 = _interopRequireDefault ( _reactTreeWalker ) ;
288
-
289
- function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
290
-
291
- function asyncBootstrapper ( app , options ) {
292
- var visitor = function visitor ( element , instance ) {
293
- if ( instance && typeof instance . asyncBootstrap === 'function' ) {
294
- return instance . asyncBootstrap ( ) ;
295
- }
296
- return true ;
297
- } ;
298
-
299
- return ( 0 , _reactTreeWalker2 . default ) ( app , visitor , { } , options ) ;
300
- }
301
-
302
298
/***/ } ) ,
303
299
/* 2 */
304
300
/***/ ( function ( module , exports ) {
0 commit comments