NativeScript 8.9 begins the first public preview of our Node-API enabled engines! This opens up a new era of NativeScript development where it can be used in engines like Hermes, QuickJS and really any Node-API enabled engine like JSC and V8. There's a lot of depth here so TSC member, Ammar Ahmed, outlined details here to learn more about this.
This post will outline all the other goodies in 8.9.
Ever wanted an easier way to create an iOS Widget? A new ns widget ios
command has been added ⭐️
Support for Android 16 KB page size, Tailwind v4 and some Quality of Life improvements, let's check it out.
Note: Node 22.12.0 or higher is required.
Updating to any minor or major version of NativeScript starts with installing the latest cli:
npm install -g nativescript
You can then confirm the latest installed with:
ns -v
You should see at least 8.9.0
or higher.
You can now run the following in your projects:
ns migrate
Various project dependencies should now be updated.
Finally ensure your project is clean:
ns clean
Note: the CLI works with older projects, so it's always recommended to run the latest CLI regardless of your particular project versions.
Here are the dependencies you can expect to be using after a successful migration:
"dependencies": {
"@nativescript/core": "~8.9.0"
},
"devDependencies": {
"@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.9.0",
"@nativescript/types": "~8.9.0",
"@nativescript/webpack": "~5.0.0"
}
Ever wanted to completely slash your app size in half? Node-API engines will allow you to do just that. As mentioned above, TSC member Ammar Ahmed outlined it all here to learn more about this.
We've updated several transient dependencies to the latest for good housekeeping and have bumped the minimum Node version requirement to 22.12.0.
In addition, we're releasing several highlights:
ns widget ios
command: Single command iOS widget creation for Home Screen Widget, Live Activity on Lock Screen or combination of both.nativescript.config
allowing them to specify their own Swift Packages for example.ns publish ios
: an item requested on our Winter 2024 survey.ns create
and choose Solid
after naming the project.Widgets display content and offer specific functionality without requiring people to open your app.
Widget extensions have been supported with NativeScript for several years. Prior to 8.9, they required a number of manual steps, for example some prior context:
You can now do all that with a single command: ns widget ios
The widget command generates all the necessary files for your NativeScript project to develop iOS widgets. The setup includes a fully functioning hypothetical pizza delivery widget which you can learn from and customize for your own needs.
You can learn all about it in the new Developing Widgets for iOS guide.
We are also providing a sample repo here which demonstrates the output the command gives you for exploration.
For the future, we are also exploring usage of NativeScript directly in the Widget UI as well, which our new Node-API enabled engines will even help with!
Prior to 8.9, you were directed to place any additional iOS source code (Obj-C, Swift, C++, etc) all within App_Resources/iOS/src
directory (or via an external plugin).
We're bringing the best of all worlds even closer together, allowing you to create Swift and Obj-C files literally anywhere you'd like, even right next to TypeScript if desired. This option also allows the generated Xcode project to neatly organize each segment in grouped folders however you prefer.
For example:
.swift
files anywhere within the project src
directory:// ...
ios: {
NativeSource: [
{
name: 'ProjectPlatformSrc',
path: './src/**/*.swift'
}
],
}
This will create a file reference folder named ProjectPlatformSrc
within the generated Xcode project containing any .swift files found anywhere within the project src
directory.
.swift
files anywhere within the project src
directory, including any (Swift, Obj-C impl/headers, as well as any module.modulemap files) within a workspace packages
dir:// ...
ios: {
NativeSource: [
{
name: 'ProjectPlatformSrc',
path: './src/**/*.swift'
},
{
name: 'Auth',
path: '../../packages/auth/**/*.{swift,m,h,modulemap}'
},
{
name: 'Purchasing',
path: '../../packages/purchasing/**/*.{swift,m,h,modulemap}'
}
],
}
You might be wondering...why not use our Swift Package support for this alone?
Our Swift Package support provides for local Swift Packages and is well suited for a lot of cases. However in some scenarios, it may be a bit of extra overhead when setting up a local Swift Package due to the public member considerations as well as public initializers one may have to consider when packaging as a Swift Package. This option allows for extra flexibility when you need it.
For the future, we're also looking at enabling this for Kotlin and Java source.
If you're developing a plugin that utilizes a Swift Package, your plugin can now define it's own config specifying so.
Consider a plugin source setup as follows:
packages
nativescript-plugin
common.ts
index.android.ts
index.d.ts
index.ios.ts
nativescript.config.ts
package.json
The nativescript.config.ts
can now specify a Swift Package dependency just like a NativeScript project would, eg:
import { NativeScriptConfig } from '@nativescript/core';
export default {
ios: {
SPMPackages: [
{
name: 'DynamicColor',
libs: ['DynamicColor'],
repositoryURL: 'https://github.com/yannickl/DynamicColor',
version: '5.0.0',
},
]
}
} as NativeScriptConfig;
When the plugin is used in a NativeScript project, it will merge that config into the project for inclusion of it's dependencies.
The nativescript.config
Swift Package support now also expands to support multiple named targets. For example, if your project includes an iOS Widget named pizza
, you can also make sure the Swift Package is included in the widget (in addition to the project):
import { NativeScriptConfig } from '@nativescript/core';
export default {
// project config details...
ios: {
SPMPackages: [
{
name: 'DynamicColor',
libs: ['DynamicColor'],
repositoryURL: 'https://github.com/yannickl/DynamicColor',
version: '5.0.0',
targets: ['pizza']
},
]
}
} as NativeScriptConfig;
You can assign any number of additional named targets for Swift Packages as needed.
ns publish ios
has existed for many years but had not been updated with latest build tooling in awhile. Due to popular demand from our 2024 Winter Survey, the command has been updated as well as docs added to cover it.
Publish iOS updates entirely with the CLI!
Learn more here: https://docs.nativescript.org/guide/publishing/ns-publish
In 8.9, core received quite a few new features and bug fixes.
See the full changelog here for details.
In 8.9, the engine now supports Android 16 KB page size, NDK 27, and Java 21.
Although not required, you can update to Java 21 for improved handling with:
brew install --cask temurin@21
Then make sure you shell profile is updated to reflect it on macOS:
export JAVA_HOME=$(/usr/libexec/java_home -v"21");
Similarly on Windows you can update your Environment variables.
For a full list of changes, see the full changelog here
In addition to including the latest of Meta's React Native JSI (Yes we can use that too if needed; learn more about what that is here: https://blog.notesnook.com/getting-started-react-native-jsi/), there were a few touchups.
For a full list of changes, see the full changelog here
You can now use tailwindcss v4.
Please see the helpful migration guide the Tailwind team made available here.
NativeScript is a production workhorse as confirmed by our 2024 Winter Survey. Out of all respondents, more use NativeScript for production than for hobby projects but interestingly the same amount use it for both production and hobby which is great to hear!
The preferred flavors further confirm that NativeScript users prefer choice and demonstrates the diversity across the industry which we fully support.
The feedback provided regarding areas that users feel need attention reflected closely to what the TSC also sees which was great news. Core and Android both received a lot of attention in this 8.9 release. The Node API Android engine preview addresses one large point by bringing faster performance and smaller app sizes.
Another survey point was to revise ns publish ios
which was also delivered in this release.
We greatly appreciate everyone's time in filling out this survey!
For those looking for fresh digs to sport in the Spring/Summer, our swag shop is now open for Preorders:
https://shop.nativescript.org/
Proceeds go right back towards innovation around NativeScript.
The NativeScript TSC (Technical Steering Committee) is comprised of disciplined visionary developers just like you whom have a strong desire to act and innovate. Is this you? If so, reach out via Discord to chat.
We follow an Open Governance Model just like Node where we elect a new TSC Chair representative each year. The kind-hearted humble talent that is Igor Randjelovic is our 2025 chair ❤️. This release was managed and created following these practices and if you have an interest in being involved in releases, we welcome you to become involved!
For the next major version, we're continuing our work on @nativescript/foundation. This is a fresh take on @nativescript/core which optimizes several keys areas and improves the abilities for where we can all go in the future.
We will also be continuing our Node-API work around the engines and look forward to hearing how the engines work for you. Please share in the community discord anytime!
Ever wondered what was involved in creating a major or minor version release of NativeScript?
For every major or minor release, the TSC picks an several entries at random to work alongside us to create the next major or minor release. We find the process insightful and fascinating everytime and want to give others the opportunity to gain insights into OSS maintenance and sustainability as well.
Whether you are starting out or a veteran, add your name by filling out this form and we will select at random during release cycles throughout the year.
Contact any of our Partners for assistance.
We would like to thank our thoughtful community for their continuous input, contributions and support across Open Collective and GitHub Sponsors ❤️ Without you, this release would not have been possible.