{"id":28447710,"url":"https://github.com/nervjs/taro-plugin-shared-runtime","last_synced_at":"2025-06-30T13:31:26.359Z","repository":{"id":65564249,"uuid":"534559540","full_name":"NervJS/taro-plugin-shared-runtime","owner":"NervJS","description":"微信小程序多分包共享Taro运行时插件","archived":false,"fork":false,"pushed_at":"2022-09-15T02:31:38.000Z","size":123,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-06-06T12:06:54.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NervJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-09T08:22:16.000Z","updated_at":"2023-03-29T07:59:43.000Z","dependencies_parsed_at":"2023-01-29T20:45:17.312Z","dependency_job_id":null,"html_url":"https://github.com/NervJS/taro-plugin-shared-runtime","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NervJS/taro-plugin-shared-runtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NervJS%2Ftaro-plugin-shared-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NervJS%2Ftaro-plugin-shared-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NervJS%2Ftaro-plugin-shared-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NervJS%2Ftaro-plugin-shared-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NervJS","download_url":"https://codeload.github.com/NervJS/taro-plugin-shared-runtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NervJS%2Ftaro-plugin-shared-runtime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262783154,"owners_count":23363482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T12:06:36.571Z","updated_at":"2025-06-30T13:31:26.343Z","avatar_url":"https://github.com/NervJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# taro-plugin-shared-runtime\n\n\u003e 微信小程序多分包、组件共享Taro运行时插件\n\n\u003e 基于Taro 3.5.1、React 18.2.0构建，含有Taro插件和运行时封装\n\n## 版本要求\n\n支持Taro 3.2.0～3.5.1版本\n\n## 安装\n\n在 Taro 项目根目录下安装\n\n```bash\nnpm i @tarojs/plugin-shared-runtime\n```\n\n在原生小程序中安装运行时（如已安装请忽略）\n\n```bash\nnpm i @tarojs/plugin-shared-runtime\n```\n\n安装成功后点击微信开发者工具菜单栏 =\u003e 工具 - 构建npm\n\n## 使用\n\n### 引入插件\n```js\nconst config = {\n    ...\n    plugins: [\n        ...\n        ...(process.env.NODE_ENV === \"development\" ? [] : [\"@tarojs/plugin-shared-runtime\"])\n    ]\n    ...\n}\n```\n\n### 注意事项\n1、当前不能使用 @tarojs/plugin-inject 等插件注入组件属性，可能导致生成的模版与运行时不匹配，导致渲染异常\n\n2、切换到公共运行时后，dom树结构会多一层根节点，对代码中直接操作dom树的逻辑可能产生影响，需要检查逻辑是否正常\n\n3、因为从原有的单实例变为多实例，应避免直接使用Current.app引用，此值为最新创建的实例，不代表当前实例，如必须使用，可以在初始化时取到此值缓存供后续调用\n\n4、组件区别于页面，实例挂载从Current.app变更到Current.root，如有直接引用Current.app的逻辑需要调整\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervjs%2Ftaro-plugin-shared-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervjs%2Ftaro-plugin-shared-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervjs%2Ftaro-plugin-shared-runtime/lists"}