您现在的位置是:首页 > 文章详情

NativeScript 8.4.0 发布,跨平台原生应用框架

日期:2022-12-02点击:319

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

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

原文链接:https://www.oschina.net/news/220301/nativescript-8-4-0-released
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章