zoukankan      html  css  js  c++  java
  • react-native start 运行流程

    在CMD下键入

    C:Node_JSMyAwesomeProject>react-native start

    运行流程:

    C:UsersGrartAppDataRoaming pm eact-native.cmd

    C:UsersGrartAppDataRoaming pm ode_modules eact-native-cliindex.js    

    cli.run();

     

    C:Node_JSMyAwesomeProject ode_modules eact-nativecli.js

    module.exports = require('./local-cli/cli.js');

     

    C:Node_JSMyAwesomeProject ode_modules eact-nativelocal-clicli.js

    module.exports = {

      run: run,

      init: init,

    };

     

     

     

    C:Node_JSMyAwesomeProject ode_modules eact-nativeprivate-clisrcserverserver.js

    C:Node_JSMyAwesomeProject ode_modules eact-nativeprivate-clisrcserver unServer.js

    function getAppMiddleware(args, config) {

        ………………………...

      return ReactPackager.middleware({

        nonPersistent: args.nonPersistent,

        projectRoots: args.projectRoots,

        blacklistRE: config.getBlacklistRE(),

        cacheVersion: '3',

        transformModulePath: transformerPath,

        assetRoots: args.assetRoots,

        assetExts: ['png', 'jpeg', 'jpg'],

        resetCache: args.resetCache || args['reset-cache'],

        polyfillModuleNames: [

          require.resolve(

            '../../../Libraries/JavaScriptAppEngine/polyfills/document.js'

          ),

        ],

        verbose: args.verbose,

      });

    }

    C:Node_JSMyAwesomeProject ode_modules eact-nativepackager eact-packagerindex.js

    function createServer(options) {

      // the debug module is configured globally, we need to enable debugging

      // *before* requiring any packages that use `debug` for logging

      if (options.verbose) {

        enableDebug();

      }

     

      startSocketInterface();

      var Server = require('./src/Server');

      return new Server(omit(options, ['verbose']));

    }

    C:Node_JSMyAwesomeProject ode_modules eact-nativepackager eact-packagersrcServerindex.js

    function processRequest(req, res, next) {

    …………

    const building = this._bundles[optionsJson] || this.buildBundle(options);

     

        this._bundles[optionsJson] = building;

        building.then(……

    )

    …………

    }

    C:Node_JSMyAwesomeProject ode_modules eact-nativepackager eact-packagersrcBundlerindex.js

    function bundle(main, runModule, sourceMapUrl, isDev, platform) {

        const bundle = new Bundle(sourceMapUrl);

        const findEventId = Activity.startEvent('find dependencies');

        let transformEventId;

     

        return this.getDependencies(main, isDev, platform)

        .then(………………

        .………………..

    }

     

    function getDependencies(main, isDev, platform) {

        return this._resolver.getDependencies(main, { dev: isDev, platform });

      }

     

     

    C:Node_JSMyAwesomeProject ode_modules eact-nativepackager eact-packagersrcDependencyResolverindex.js

     

    HasteDependencyResolver.prototype.getDependencies = function(main, options) {

      var opts = getDependenciesValidateOpts(options);

     

      return this._depGraph.getDependencies(main, opts.platform)

      .then(

        resolutionResponse => {

          this._getPolyfillDependencies(opts.dev).reverse().forEach(

            polyfill => resolutionResponse.prependDependency(polyfill)

          );

     

          return resolutionResponse.finalize();

        }

      );

    };

    C:Node_JSMyAwesomeProject ode_modules eact-nativepackager eact-packagersrcDependencyResolverDependencyGraphindex

     

      getDependencies(entryPath, platform) {

        console.log('call DependencyGraph entryPath='+entryPath);

        return this.load()

        .then(

          () => {

            platform = this._getRequestPlatform(entryPath, platform);

            const absPath = this._getAbsolutePath(entryPath);

            const req = new ResolutionRequest({

              platform,

              entryPath: absPath,

              deprecatedAssetMap: this._deprecatedAssetMap,

              hasteMap: this._hasteMap,

              helpers: this._helpers,

              moduleCache: this._moduleCache,

              fastfs: this._fastfs,

            });

     

            const response = new ResolutionResponse();

            console.log('call ResolutionRequest');

            return Promise.all([

              req.getOrderedDependencies(response),

              req.getAsyncDependencies(response),

            ]).then(() => response);

          }

        );

      }

    C:Node_JSMyAwesomeProject ode_modules eact-nativepackager eact-packagersrcDependencyResolverDependencyGraphResolutionRequest.js

    getOrderedDependencies(response) {….

    resolveDependency(fromModule, toModuleName) {….

    _resolveNodeDependency(fromModule, toModuleName) {….

    _loadAsFile(potentialModulePath, fromModule, toModule) {….

      this._fastfs.fileExists(potentialModulePath)

     

  • 相关阅读:
    Mahout机器学习平台之聚类算法具体剖析(含实例分析)
    算法导论 动态规划 钢条分割问题的自底向上解法
    玩转Linux网络namespace-单机自环測试与策略路由
    Unity KillCount
    android 项目中使用到的网络请求框架以及怎样配置好接口URL
    Gradle 1.12 翻译——第十四章. 教程
    MySQL 性能优化
    Git教程
    Eclipse常用小知识汇总
    自定义全局异常捕获
  • 原文地址:https://www.cnblogs.com/Grart/p/5081656.html
Copyright © 2011-2022 走看看