Feature/ios oc primitive type mapping - #66
Open
zhugeafanti wants to merge 8 commits into
Open
Conversation
zhugeafanti
commented
Aug 14, 2026
Collaborator
- 【iOS】优化 iOS 平台基础类型映射
- 【Android & iOS】ChannelBuffers 支持 resize
@UniNativeModule 场景下,非空基础类型(int/double/bool)由统一装箱的 NSNumber* 改为原生标量(NSInteger/double/BOOL),使生成的 OC 接口参数与 返回值类型与 Dart 声明一致。可空类型及集合泛型实参位置仍回退 NSNumber*。 - ast_int/double/bool: ocType() 加可空回退,非空返回标量 - oc_reference: 白名单加标量类型;新增 boxed 开关处理集合泛型位置 - ast_list/map: 泛型渲染传 boxed:true,保证 OC 集合泛型为对象类型 - ast_extension: 解参数拆箱、编返回值装箱的胶水,与标量映射对齐 - oc_class: UniCallback 回调 @"data" value 对非空标量装箱 @(...)
回归验证 01_uninativemodule / 02_unifluttermodule / 03_unicallback 三个 示例,覆盖非空标量、可空回退、集合泛型、UniCallback 回调等场景,确认生成 的 OC 代码合法且 Dart/Java 端无回归。 interface 增加 int/bool/double、Map<String,int>、UniCallback<bool> 等 用例;lib/android/ios 目录为对应重新生成的产物。
在 UniFlutterModule 模式(native -> dart)新增 @UniBufferSize(n) 注解, 生成的原生 setup 会对标注方法的 channel 调用 resizeChannelBuffer(iOS/Android), 解决原生在 Dart handler 注册前连发消息时早到消息被丢弃的问题。 - 未标注方法保持原有逻辑不变(不生成任何代码) - n 必须为正整数字面量,非法值告警并忽略 - 与 @RequiredMessager 同时标注时忽略并告警(目标 messenger 由每次调用决定) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
承接 3.0.6 标量映射改动。UniCompleted 回调形参为 id,而非空标量返回值经 convertOcJson2Obj 拆箱成 NSInteger/BOOL/double 后直接传入,触发 'Implicit conversion ... to id is disallowed with ARC'。 给 convertOcJson2Obj 增加 asObject 开关(默认 false,其余调用方行为不变), 目标为 id 时不拆箱,沿用 channel 传来的 NSNumber;回调路径改用 asObject:true。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- README / README.zh-CN 新增'扩大 Channel 缓冲区'章节,说明用法、示例与边界 - CHANGELOG 3.0.6 记录 @UniBufferSize 特性及回调 ARC 修复 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 02_unifluttermodule_demo: interface 增加 @UniBufferSize(100) 用法示例, 重新生成后 setup 带 resizeChannelBuffer;回调路径应用 ARC 修复 - 01/02 生成产物版本横幅同步至 3.0.6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.