NativeScript 8.4.0 发布,跨平台原生应用框架
NativeScript 8.4.0现已发布。NativeScript 使用户能够直接从 JavaScript 访问native API。目前,该框架为丰富的移动开发提供了 iOS 和 Android 运行时,并可用于多种不同的用例。 Features android:支持 ImageSource 中的 drawable (#10098) (75eefa6) android:使用 NestedScrollView 来实现垂直 ScrollView (#9199) (cfaa813) core:支持 css 字体变化设置 (#9995) (a5e3e22) core:支持外部 XML UI 编译器 (#10008) (75503ef) HtmlView:可选属性 (#10057) (ca9c092) types-android:API Level 33 (#10113) (c1187fe) types-ios:16.1 (#10114) (da78e0b) utils:dismissKeyboard、copyToClipboard、setWindowBackgroundColor、getCurrentActivity 和 getResource (#10089) (2e1d2c1) webview:添加 iosAllowInlineMediaPlayback 属性 (#10014) (4a0e1c9) TypeScript 4.8+ 支持和 NativeClass decorator 改进 (#10081) (7f069a7) Performance Improvements core:android sdk 检查(#10084)(abd722c) Breaking Changes utils/utils is just Utils BEFORE import { layout } from '@nativescript/core/utils/utils' AFTER import { Utils } from '@nativescript/core' Utils.layout 这会影响一些插件。如果你使用遇到此问题的插件,可以执行以下操作: 1、暂时添加一个快速的 webpack 别名来缓解: webpack.chainWebpack(config => { config.resolve.alias.set('@nativescript/core/utils/utils', '@nativescript/core/utils'); config.resolve.alias.set('tns-core-modules/utils/utils', '@nativescript/core/utils'); config.resolve.alias.set('tns-core-modules', '@nativescript/core'); 2、向插件作者提交拉取请求。 WeakRef type Core 使用最新的 WeakRef 类型,你可以将 tsconfig 更新到最新的 targets.。 BEFORE tsconfig.json "compilerOptions": { "target": "es2017", ... "lib": ["es6", "dom"], AFTER "compilerOptions": { "target": "es2020", ... "lib": ["esnext", "dom"], 更多详情可查看:https://github.com/NativeScript/NativeScript/releases/tag/8.4.0-core