Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

适配新版本IDE 5.0.1 #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

适配新版本IDE 5.0.1 #27

wants to merge 2 commits into from

Conversation

shouyong
Copy link

@shouyong shouyong commented Dec 4, 2024

升级项目,按官方要求进行项目迁移。

@@ -7,6 +7,8 @@
{
"name": "default",
"signingConfig": "default",
"compatibleSdkVersion": "4.0.0(10)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否应该迁移到 API12?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

支持12的。

log.info(n.toString());
})
Button("Get Undefined").onClick(() => {
const u = basic.getUndefined();
const u :undefined= basic.getUndefined();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类型完善的情况下,是否可以移除这些类型声明

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经移除。

"name": "libarray.so",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里没有 type 字段?看起来加了类型没什么实际的意义。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因 使用新版 IDE报错无法编译运行项目才手动添加的类型。

export const mutateInt16Array: (a: Int16Array) => undefined;
export const mutateFloat32Array: (a: Float32Array) => undefined;
export const mutateFloat64Array: (a: Float64Array) => undefined;
export const mutateI64Array: (a: BigInt64Array) => undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类型用自动生成的吧,不要手写。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohos能自动生成类型? 我没找到相关文档,要是能自动生成这个PR就可以关了。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohrs 对于使用 napi 修饰的宏会自动生成类型包。也不完全关闭,工程升级到 12 还是有必要的。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohrs 对于使用 napi 修饰的宏会自动生成类型包。也不完全关闭,工程升级到 12 还是有必要的。

ohrs 对于使用 napi 修饰的宏会自动生成类型包。 请教下, 这个我没看到?如何操作才会生成类型文件?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://ohos.rs/docs/basic/quick-start.html
通过 ohrs 构建之后在 dist 文件夹有对应的类型文件,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
我哪儿操作不对? build 后没类型文件,升级到了最新版本后 还是没。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants