# dynamic **Repository Path**: celestialbeing/dynamic ## Basic Information - **Project Name**: dynamic - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-24 - **Last Updated**: 2022-02-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # happy-react-native (HRN) # 希望你每天都能happy # 文献 # https://lihautan.com/babel-ast-explorer # https://github.com/jamiebuilds/babel-handbook/blob/master/translations/zh-Hans/plugin-handbook.md # https://www.babeljs.cn/docs/babel-types#debuggerstatement # https://babel.docschina.org/docs/en/plugins-list/ # https://facebook.github.io/metro/docs/getting-started/ babel 贝伯 ```js // metro.config.js const { mergeConfig } = require('metro-config'); const { metroConfig } = require('/Users/gang/Desktop/DRN/dynamic/metro/metroConfig'); const configA = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false, }, }), }, }; module.exports = mergeConfig(configA, metroConfig); ``` ```js // presets: ["module:metro-react-native-babel-preset"], ``` # 思路 1 打包记录 ID babel 转换替换 require 为 ID 生成 json loader 加载器 # 思路 2 打包记录 ID 表 android/ios babel 转换替换 ids.get("react-native-xxx"); 动态 id; 静态资源 babel 处理 生成 json loader 加载器 vm 沙箱 传入 ID 表 路径识别 # 思路3 所有资源id锁定。 # 功能 1. 哈希 版本更新控制 # 问题 1. 打包 module id 路 与 main 入口 不一致 ? 2. tran 无后缀匹配 3. 跨端 .android.js .ios.js ID 不一致 4. 父页面,子组件名称相同如何处理? 5. 多个版本同时在线如何处理?暂不考虑 6. 子组件识别以及处理 7.