7
7
exports [ "ReactRailsUJS" ] = factory ( require ( "react-dom" ) , require ( "react" ) , require ( "react-dom/server" ) ) ;
8
8
else
9
9
root [ "ReactRailsUJS" ] = factory ( root [ "ReactDOM" ] , root [ "React" ] , root [ "ReactDOMServer" ] ) ;
10
- } ) ( this , function ( __WEBPACK_EXTERNAL_MODULE_1__ , __WEBPACK_EXTERNAL_MODULE_5__ , __WEBPACK_EXTERNAL_MODULE_6__ ) {
10
+ } ) ( this , function ( __WEBPACK_EXTERNAL_MODULE_2__ , __WEBPACK_EXTERNAL_MODULE_6__ , __WEBPACK_EXTERNAL_MODULE_7__ ) {
11
11
return /******/ ( function ( modules ) { // webpackBootstrap
12
12
/******/ // The module cache
13
13
/******/ var installedModules = { } ;
@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap
73
73
/******/ __webpack_require__ . p = "" ;
74
74
/******/
75
75
/******/ // Load entry module and return exports
76
- /******/ return __webpack_require__ ( __webpack_require__ . s = 7 ) ;
76
+ /******/ return __webpack_require__ ( __webpack_require__ . s = 8 ) ;
77
77
/******/ } )
78
78
/************************************************************************/
79
79
/******/ ( [
@@ -108,17 +108,47 @@ module.exports = function(className) {
108
108
/* 1 */
109
109
/***/ ( function ( module , exports ) {
110
110
111
- module . exports = __WEBPACK_EXTERNAL_MODULE_1__ ;
111
+ // Load React components by requiring them from "components/", for example:
112
+ //
113
+ // - "pages/index" -> `require("components/pages/index")`
114
+ // - "pages/show.Header" -> `require("components/pages/show").Header`
115
+ // - "pages/show.Body.Content" -> `require("components/pages/show").Body.Content`
116
+ //
117
+ module . exports = function ( reqctx ) {
118
+ return function ( className ) {
119
+ var parts = className . split ( "." )
120
+ var filename = parts . shift ( )
121
+ var keys = parts
122
+ // Load the module:
123
+ var component = reqctx ( "./" + filename )
124
+ // Then access each key:
125
+ keys . forEach ( function ( k ) {
126
+ component = component [ k ]
127
+ } )
128
+ // support `export default`
129
+ if ( component . __esModule ) {
130
+ component = component [ "default" ]
131
+ }
132
+ return component
133
+ }
134
+ }
135
+
112
136
113
137
/***/ } ) ,
114
138
/* 2 */
139
+ /***/ ( function ( module , exports ) {
140
+
141
+ module . exports = __WEBPACK_EXTERNAL_MODULE_2__ ;
142
+
143
+ /***/ } ) ,
144
+ /* 3 */
115
145
/***/ ( function ( module , exports , __webpack_require__ ) {
116
146
117
- var nativeEvents = __webpack_require__ ( 8 )
118
- var pjaxEvents = __webpack_require__ ( 9 )
119
- var turbolinksEvents = __webpack_require__ ( 10 )
120
- var turbolinksClassicDeprecatedEvents = __webpack_require__ ( 12 )
121
- var turbolinksClassicEvents = __webpack_require__ ( 11 )
147
+ var nativeEvents = __webpack_require__ ( 9 )
148
+ var pjaxEvents = __webpack_require__ ( 10 )
149
+ var turbolinksEvents = __webpack_require__ ( 11 )
150
+ var turbolinksClassicDeprecatedEvents = __webpack_require__ ( 13 )
151
+ var turbolinksClassicEvents = __webpack_require__ ( 12 )
122
152
123
153
// see what things are globally available
124
154
// and setup event handlers to those things
@@ -170,14 +200,14 @@ module.exports = function(ujs) {
170
200
171
201
172
202
/***/ } ) ,
173
- /* 3 */
203
+ /* 4 */
174
204
/***/ ( function ( module , exports , __webpack_require__ ) {
175
205
176
206
// Make a function which:
177
207
// - First tries to require the name
178
208
// - Then falls back to global lookup
179
209
var fromGlobal = __webpack_require__ ( 0 )
180
- var fromRequireContext = __webpack_require__ ( 13 )
210
+ var fromRequireContext = __webpack_require__ ( 1 )
181
211
182
212
module . exports = function ( reqctx ) {
183
213
var fromCtx = fromRequireContext ( reqctx )
@@ -201,15 +231,15 @@ module.exports = function(reqctx) {
201
231
202
232
203
233
/***/ } ) ,
204
- /* 4 */
234
+ /* 5 */
205
235
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
206
236
207
237
"use strict" ;
208
238
Object . defineProperty ( __webpack_exports__ , "__esModule" , { value : true } ) ;
209
239
/* harmony export (immutable) */ __webpack_exports__ [ "supportsHydration" ] = supportsHydration ;
210
240
/* harmony export (immutable) */ __webpack_exports__ [ "reactHydrate" ] = reactHydrate ;
211
241
/* harmony export (immutable) */ __webpack_exports__ [ "createReactRootLike" ] = createReactRootLike ;
212
- const ReactDOM = __webpack_require__ ( 1 )
242
+ const ReactDOM = __webpack_require__ ( 2 )
213
243
214
244
function supportsHydration ( ) {
215
245
return typeof ReactDOM . hydrate === "function" || typeof ReactDOM . hydrateRoot === "function"
@@ -238,29 +268,30 @@ function legacyReactRootLike(node) {
238
268
239
269
240
270
/***/ } ) ,
241
- /* 5 */
271
+ /* 6 */
242
272
/***/ ( function ( module , exports ) {
243
273
244
- module . exports = __WEBPACK_EXTERNAL_MODULE_5__ ;
274
+ module . exports = __WEBPACK_EXTERNAL_MODULE_6__ ;
245
275
246
276
/***/ } ) ,
247
- /* 6 */
277
+ /* 7 */
248
278
/***/ ( function ( module , exports ) {
249
279
250
- module . exports = __WEBPACK_EXTERNAL_MODULE_6__ ;
280
+ module . exports = __WEBPACK_EXTERNAL_MODULE_7__ ;
251
281
252
282
/***/ } ) ,
253
- /* 7 */
283
+ /* 8 */
254
284
/***/ ( function ( module , exports , __webpack_require__ ) {
255
285
256
- var React = __webpack_require__ ( 5 )
257
- var ReactDOM = __webpack_require__ ( 1 )
258
- var ReactDOMServer = __webpack_require__ ( 6 )
286
+ var React = __webpack_require__ ( 6 )
287
+ var ReactDOM = __webpack_require__ ( 2 )
288
+ var ReactDOMServer = __webpack_require__ ( 7 )
259
289
260
- var detectEvents = __webpack_require__ ( 2 )
290
+ var detectEvents = __webpack_require__ ( 3 )
261
291
var constructorFromGlobal = __webpack_require__ ( 0 )
262
- var constructorFromRequireContextWithGlobalFallback = __webpack_require__ ( 3 )
263
- const { supportsHydration, reactHydrate, createReactRootLike } = __webpack_require__ ( 4 )
292
+ var constructorFromRequireContext = __webpack_require__ ( 1 )
293
+ var constructorFromRequireContextWithGlobalFallback = __webpack_require__ ( 4 )
294
+ const { supportsHydration, reactHydrate, createReactRootLike } = __webpack_require__ ( 5 )
264
295
265
296
var ReactRailsUJS = {
266
297
// This attribute holds the name of component which should be mounted
@@ -321,6 +352,11 @@ var ReactRailsUJS = {
321
352
// the default is ReactRailsUJS.ComponentGlobal
322
353
getConstructor : constructorFromGlobal ,
323
354
355
+ // Available for customizing `getConstructor`
356
+ constructorFromGlobal : constructorFromGlobal ,
357
+ constructorFromRequireContext : constructorFromRequireContext ,
358
+ constructorFromRequireContextWithGlobalFallback : constructorFromRequireContextWithGlobalFallback ,
359
+
324
360
// Given a Webpack `require.context`,
325
361
// try finding components with `require`,
326
362
// then falling back to global lookup.
@@ -395,6 +431,7 @@ var ReactRailsUJS = {
395
431
detectEvents : function ( ) {
396
432
detectEvents ( this )
397
433
} ,
434
+
398
435
}
399
436
400
437
// These stable references are so that handlers can be added and removed:
@@ -429,7 +466,7 @@ module.exports = ReactRailsUJS
429
466
430
467
431
468
/***/ } ) ,
432
- /* 8 */
469
+ /* 9 */
433
470
/***/ ( function ( module , exports ) {
434
471
435
472
module . exports = {
@@ -452,7 +489,7 @@ module.exports = {
452
489
453
490
454
491
/***/ } ) ,
455
- /* 9 */
492
+ /* 10 */
456
493
/***/ ( function ( module , exports ) {
457
494
458
495
module . exports = {
@@ -472,7 +509,7 @@ module.exports = {
472
509
473
510
474
511
/***/ } ) ,
475
- /* 10 */
512
+ /* 11 */
476
513
/***/ ( function ( module , exports ) {
477
514
478
515
module . exports = {
@@ -488,7 +525,7 @@ module.exports = {
488
525
489
526
490
527
/***/ } ) ,
491
- /* 11 */
528
+ /* 12 */
492
529
/***/ ( function ( module , exports ) {
493
530
494
531
module . exports = {
@@ -506,7 +543,7 @@ module.exports = {
506
543
507
544
508
545
/***/ } ) ,
509
- /* 12 */
546
+ /* 13 */
510
547
/***/ ( function ( module , exports ) {
511
548
512
549
module . exports = {
@@ -526,36 +563,6 @@ module.exports = {
526
563
}
527
564
528
565
529
- /***/ } ) ,
530
- /* 13 */
531
- /***/ ( function ( module , exports ) {
532
-
533
- // Load React components by requiring them from "components/", for example:
534
- //
535
- // - "pages/index" -> `require("components/pages/index")`
536
- // - "pages/show.Header" -> `require("components/pages/show").Header`
537
- // - "pages/show.Body.Content" -> `require("components/pages/show").Body.Content`
538
- //
539
- module . exports = function ( reqctx ) {
540
- return function ( className ) {
541
- var parts = className . split ( "." )
542
- var filename = parts . shift ( )
543
- var keys = parts
544
- // Load the module:
545
- var component = reqctx ( "./" + filename )
546
- // Then access each key:
547
- keys . forEach ( function ( k ) {
548
- component = component [ k ]
549
- } )
550
- // support `export default`
551
- if ( component . __esModule ) {
552
- component = component [ "default" ]
553
- }
554
- return component
555
- }
556
- }
557
-
558
-
559
566
/***/ } )
560
567
/******/ ] ) ;
561
568
} ) ;
0 commit comments