77exports [ "ReactRailsUJS" ] = factory ( require ( "react-dom" ) , require ( "react" ) , require ( "react-dom/server" ) ) ;
88else
99root [ "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__ ) {
1111return /******/ ( function ( modules ) { // webpackBootstrap
1212/******/ // The module cache
1313/******/ var installedModules = { } ;
@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap
7373/******/ __webpack_require__ . p = "" ;
7474/******/
7575/******/ // Load entry module and return exports
76- /******/ return __webpack_require__ ( __webpack_require__ . s = 7 ) ;
76+ /******/ return __webpack_require__ ( __webpack_require__ . s = 8 ) ;
7777/******/ } )
7878/************************************************************************/
7979/******/ ( [
@@ -108,17 +108,47 @@ module.exports = function(className) {
108108/* 1 */
109109/***/ ( function ( module , exports ) {
110110
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+
112136
113137/***/ } ) ,
114138/* 2 */
139+ /***/ ( function ( module , exports ) {
140+
141+ module . exports = __WEBPACK_EXTERNAL_MODULE_2__ ;
142+
143+ /***/ } ) ,
144+ /* 3 */
115145/***/ ( function ( module , exports , __webpack_require__ ) {
116146
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 )
122152
123153// see what things are globally available
124154// and setup event handlers to those things
@@ -170,14 +200,14 @@ module.exports = function(ujs) {
170200
171201
172202/***/ } ) ,
173- /* 3 */
203+ /* 4 */
174204/***/ ( function ( module , exports , __webpack_require__ ) {
175205
176206// Make a function which:
177207// - First tries to require the name
178208// - Then falls back to global lookup
179209var fromGlobal = __webpack_require__ ( 0 )
180- var fromRequireContext = __webpack_require__ ( 13 )
210+ var fromRequireContext = __webpack_require__ ( 1 )
181211
182212module . exports = function ( reqctx ) {
183213 var fromCtx = fromRequireContext ( reqctx )
@@ -201,15 +231,15 @@ module.exports = function(reqctx) {
201231
202232
203233/***/ } ) ,
204- /* 4 */
234+ /* 5 */
205235/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
206236
207237"use strict" ;
208238Object . defineProperty ( __webpack_exports__ , "__esModule" , { value : true } ) ;
209239/* harmony export (immutable) */ __webpack_exports__ [ "supportsHydration" ] = supportsHydration ;
210240/* harmony export (immutable) */ __webpack_exports__ [ "reactHydrate" ] = reactHydrate ;
211241/* harmony export (immutable) */ __webpack_exports__ [ "createReactRootLike" ] = createReactRootLike ;
212- const ReactDOM = __webpack_require__ ( 1 )
242+ const ReactDOM = __webpack_require__ ( 2 )
213243
214244function supportsHydration ( ) {
215245 return typeof ReactDOM . hydrate === "function" || typeof ReactDOM . hydrateRoot === "function"
@@ -238,29 +268,30 @@ function legacyReactRootLike(node) {
238268
239269
240270/***/ } ) ,
241- /* 5 */
271+ /* 6 */
242272/***/ ( function ( module , exports ) {
243273
244- module . exports = __WEBPACK_EXTERNAL_MODULE_5__ ;
274+ module . exports = __WEBPACK_EXTERNAL_MODULE_6__ ;
245275
246276/***/ } ) ,
247- /* 6 */
277+ /* 7 */
248278/***/ ( function ( module , exports ) {
249279
250- module . exports = __WEBPACK_EXTERNAL_MODULE_6__ ;
280+ module . exports = __WEBPACK_EXTERNAL_MODULE_7__ ;
251281
252282/***/ } ) ,
253- /* 7 */
283+ /* 8 */
254284/***/ ( function ( module , exports , __webpack_require__ ) {
255285
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 )
259289
260- var detectEvents = __webpack_require__ ( 2 )
290+ var detectEvents = __webpack_require__ ( 3 )
261291var 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 )
264295
265296var ReactRailsUJS = {
266297 // This attribute holds the name of component which should be mounted
@@ -321,6 +352,11 @@ var ReactRailsUJS = {
321352 // the default is ReactRailsUJS.ComponentGlobal
322353 getConstructor : constructorFromGlobal ,
323354
355+ // Available for customizing `getConstructor`
356+ constructorFromGlobal : constructorFromGlobal ,
357+ constructorFromRequireContext : constructorFromRequireContext ,
358+ constructorFromRequireContextWithGlobalFallback : constructorFromRequireContextWithGlobalFallback ,
359+
324360 // Given a Webpack `require.context`,
325361 // try finding components with `require`,
326362 // then falling back to global lookup.
@@ -395,6 +431,7 @@ var ReactRailsUJS = {
395431 detectEvents : function ( ) {
396432 detectEvents ( this )
397433 } ,
434+
398435}
399436
400437// These stable references are so that handlers can be added and removed:
@@ -429,7 +466,7 @@ module.exports = ReactRailsUJS
429466
430467
431468/***/ } ) ,
432- /* 8 */
469+ /* 9 */
433470/***/ ( function ( module , exports ) {
434471
435472module . exports = {
@@ -452,7 +489,7 @@ module.exports = {
452489
453490
454491/***/ } ) ,
455- /* 9 */
492+ /* 10 */
456493/***/ ( function ( module , exports ) {
457494
458495module . exports = {
@@ -472,7 +509,7 @@ module.exports = {
472509
473510
474511/***/ } ) ,
475- /* 10 */
512+ /* 11 */
476513/***/ ( function ( module , exports ) {
477514
478515module . exports = {
@@ -488,7 +525,7 @@ module.exports = {
488525
489526
490527/***/ } ) ,
491- /* 11 */
528+ /* 12 */
492529/***/ ( function ( module , exports ) {
493530
494531module . exports = {
@@ -506,7 +543,7 @@ module.exports = {
506543
507544
508545/***/ } ) ,
509- /* 12 */
546+ /* 13 */
510547/***/ ( function ( module , exports ) {
511548
512549module . exports = {
@@ -526,36 +563,6 @@ module.exports = {
526563}
527564
528565
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-
559566/***/ } )
560567/******/ ] ) ;
561568} ) ;
0 commit comments