repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 10.6 kB
JSON
{"ast":null,"code":"'use client';\n\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from \"../unmountComponentAtNode\";\nimport renderApplication, { getApplication as _getApplication } from \"./renderApplication\";\nvar emptyObject = {};\nvar runnables = {};\nvar componentProviderInstrumentationHook = component => component();\nvar wrapperComponentProvider;\nexport default class AppRegistry {\n static getAppKeys() {\n return Object.keys(runnables);\n }\n static getApplication(appKey, appParameters) {\n invariant(runnables[appKey] && runnables[appKey].getApplication, \"Application \" + appKey + \" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].getApplication(appParameters);\n }\n static registerComponent(appKey, componentProvider) {\n runnables[appKey] = {\n getApplication: appParameters => _getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters)),\n run: appParameters => renderApplication(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {\n hydrate: appParameters.hydrate || false,\n initialProps: appParameters.initialProps || emptyObject,\n mode: appParameters.mode || 'concurrent',\n rootTag: appParameters.rootTag\n })\n };\n return appKey;\n }\n static registerConfig(config) {\n config.forEach(_ref => {\n var appKey = _ref.appKey,\n component = _ref.component,\n run = _ref.run;\n if (run) {\n AppRegistry.registerRunnable(appKey, run);\n } else {\n invariant(component, 'No component provider passed in');\n AppRegistry.registerComponent(appKey, component);\n }\n });\n }\n static registerRunnable(appKey, run) {\n runnables[appKey] = {\n run\n };\n return appKey;\n }\n static runApplication(appKey, appParameters) {\n var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n if (isDevelopment) {\n var params = _objectSpread({}, appParameters);\n params.rootTag = \"#\" + params.rootTag.id;\n console.log(\"Running application \\\"\" + appKey + \"\\\" with appParams:\\n\", params, \"\\nDevelopment-level warnings: \" + (isDevelopment ? 'ON' : 'OFF') + \".\" + (\"\\nPerformance optimizations: \" + (isDevelopment ? 'OFF' : 'ON') + \".\"));\n }\n invariant(runnables[appKey] && runnables[appKey].run, \"Application \\\"\" + appKey + \"\\\" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].run(appParameters);\n }\n static setComponentProviderInstrumentationHook(hook) {\n componentProviderInstrumentationHook = hook;\n }\n static setWrapperComponentProvider(provider) {\n wrapperComponentProvider = provider;\n }\n static unmountApplicationComponentAtRootTag(rootTag) {\n unmountComponentAtNode(rootTag);\n }\n}","map":{"version":3,"names":["_objectSpread","invariant","unmountComponentAtNode","renderApplication","getApplication","_getApplication","emptyObject","runnables","componentProviderInstrumentationHook","component","wrapperComponentProvider","AppRegistry","getAppKeys","Object","keys","appKey","appParameters","registerComponent","componentProvider","initialProps","run","callback","hydrate","mode","rootTag","registerConfig","config","forEach","_ref","registerRunnable","runApplication","isDevelopment","process","env","NODE_ENV","params","id","console","log","setComponentProviderInstrumentationHook","hook","setWrapperComponentProvider","provider","unmountApplicationComponentAtRootTag"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/exports/AppRegistry/index.js"],"sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n'use client';\n\nimport _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from '../unmountComponentAtNode';\nimport renderApplication, { getApplication as _getApplication } from './renderApplication';\nvar emptyObject = {};\nvar runnables = {};\nvar componentProviderInstrumentationHook = component => component();\nvar wrapperComponentProvider;\n\n/**\n * `AppRegistry` is the JS entry point to running all React Native apps.\n */\nexport default class AppRegistry {\n static getAppKeys() {\n return Object.keys(runnables);\n }\n static getApplication(appKey, appParameters) {\n invariant(runnables[appKey] && runnables[appKey].getApplication, \"Application \" + appKey + \" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].getApplication(appParameters);\n }\n static registerComponent(appKey, componentProvider) {\n runnables[appKey] = {\n getApplication: appParameters => _getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters)),\n run: appParameters => renderApplication(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {\n hydrate: appParameters.hydrate || false,\n initialProps: appParameters.initialProps || emptyObject,\n mode: appParameters.mode || 'concurrent',\n rootTag: appParameters.rootTag\n })\n };\n return appKey;\n }\n static registerConfig(config) {\n config.forEach(_ref => {\n var appKey = _ref.appKey,\n component = _ref.component,\n run = _ref.run;\n if (run) {\n AppRegistry.registerRunnable(appKey, run);\n } else {\n invariant(component, 'No component provider passed in');\n AppRegistry.registerComponent(appKey, component);\n }\n });\n }\n\n // TODO: fix style sheet creation when using this method\n static registerRunnable(appKey, run) {\n runnables[appKey] = {\n run\n };\n return appKey;\n }\n static runApplication(appKey, appParameters) {\n var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n if (isDevelopment) {\n var params = _objectSpread({}, appParameters);\n params.rootTag = \"#\" + params.rootTag.id;\n console.log(\"Running application \\\"\" + appKey + \"\\\" with appParams:\\n\", params, \"\\nDevelopment-level warnings: \" + (isDevelopment ? 'ON' : 'OFF') + \".\" + (\"\\nPerformance optimizations: \" + (isDevelopment ? 'OFF' : 'ON') + \".\"));\n }\n invariant(runnables[appKey] && runnables[appKey].run, \"Application \\\"\" + appKey + \"\\\" has not been registered. \" + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');\n return runnables[appKey].run(appParameters);\n }\n static setComponentProviderInstrumentationHook(hook) {\n componentProviderInstrumentationHook = hook;\n }\n static setWrapperComponentProvider(provider) {\n wrapperComponentProvider = provider;\n }\n static unmountApplicationComponentAtRootTag(rootTag) {\n unmountComponentAtNode(rootTag);\n }\n}"],"mappings":"AAUA,YAAY;;AAEZ,OAAOA,aAAa,MAAM,sCAAsC;AAChE,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,sBAAsB;AAC7B,OAAOC,iBAAiB,IAAIC,cAAc,IAAIC,eAAe;AAC7D,IAAIC,WAAW,GAAG,CAAC,CAAC;AACpB,IAAIC,SAAS,GAAG,CAAC,CAAC;AAClB,IAAIC,oCAAoC,GAAGC,SAAS,IAAIA,SAAS,CAAC,CAAC;AACnE,IAAIC,wBAAwB;AAK5B,eAAe,MAAMC,WAAW,CAAC;EAC/B,OAAOC,UAAUA,CAAA,EAAG;IAClB,OAAOC,MAAM,CAACC,IAAI,CAACP,SAAS,CAAC;EAC/B;EACA,OAAOH,cAAcA,CAACW,MAAM,EAAEC,aAAa,EAAE;IAC3Cf,SAAS,CAACM,SAAS,CAACQ,MAAM,CAAC,IAAIR,SAAS,CAACQ,MAAM,CAAC,CAACX,cAAc,EAAE,cAAc,GAAGW,MAAM,GAAG,4BAA4B,GAAG,+GAA+G,CAAC;IAC1O,OAAOR,SAAS,CAACQ,MAAM,CAAC,CAACX,cAAc,CAACY,aAAa,CAAC;EACxD;EACA,OAAOC,iBAAiBA,CAACF,MAAM,EAAEG,iBAAiB,EAAE;IAClDX,SAAS,CAACQ,MAAM,CAAC,GAAG;MAClBX,cAAc,EAAEY,aAAa,IAAIX,eAAe,CAACG,oCAAoC,CAACU,iBAAiB,CAAC,EAAEF,aAAa,GAAGA,aAAa,CAACG,YAAY,GAAGb,WAAW,EAAEI,wBAAwB,IAAIA,wBAAwB,CAACM,aAAa,CAAC,CAAC;MACxOI,GAAG,EAAEJ,aAAa,IAAIb,iBAAiB,CAACK,oCAAoC,CAACU,iBAAiB,CAAC,EAAER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