NativeScript / NativeScript/android

[FR] Customize metadata generation to avoid adding unnecessary unused JS wrappers

未关闭
#1,485 6 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature optimization
主要语言
C++
星标
563
派生
144
平均合并
10 小时 46 分钟
30 天内合并 PR
14

描述

Is your feature request related to a problem? Please describe.
Currently, the whole Android SDK and all native libraries used in a {N} app are included in the metadata binary files. In order to reduce app size and improve startup performance, we should allow app/plugin developers to specify which entities (e.g. Java packages) need to actually be accessible from JavaScript.

Additional context
Things to consider:

  • This will be a breaking change because every plugin and every app which directly call into native code will need to start stating their native dependencies
  • Multiple such dependency lists coming from all plugins and the app should be merged. Maybe some changes in the CLI will be necessary as well.
  • There should be a way to allow everything to be included (like it's been before this feature)

An idea for UI which helps generate these lists from @shirakaba: Polyfill.io shows one user interface by which one could generate a package by specifying only the libraries that one needs. Maybe something like this could be applied to the NativeScript runtimes: https://polyfill.io/v3/url-builder/

Corresponding feature request in iOS runtime is: https://github.com/NativeScript/ios-runtime/issues/1209

Implemented in {N} CLI with: https://github.com/NativeScript/nativescript-cli/issues/5220

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定 Android 文件、测试或入口点。先从链接的 NativeScript CLI issue #5220 和对应的 iOS runtime issue #1209 开始,然后确定 Android 元数据生成应如何使用合并后的应用和插件依赖列表;完成内容应包括一种 opt-in 方式来限制公开的实体,以及一种保留现有“包含全部内容”行为的方式。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, javascript
领域
build-system, mobile-dev
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。