Repository navigation
Releases
v0.32.0
🩹 Fixes
-
On Android, a text's
maxFontSizeMultipliernow caps its line height as it caps its font size, so capped text at a large system text size is no longer drawn in a line box too tall for it. (#2050, #2044)React Native's Android text scales
lineHeightby the whole system text size while it capsfontSize, so at a text size of 3.2 an 11 point text capped at 1.25 with a 15 point line height got a 48 point line box and drew its letters below a short box. The engine now commits a line height that Android scales to the capped size, for a line height set inline or by a class (in points or unitless), for one a nested text inherits, with the cap taken from the text or the nearest text around it, and following the cap or the system text size changing. iOS already capped the line height natively and is unchanged. Atext-input's line height is not changed. -
On Android, hardware Back (or the Back gesture) now closes a
native-search-baropen in anative-headerbefore it leaves the screen, as a native search toolbar does. (#2048, #2042)Before, the stack popped the screen with the search still open. Once the field has closed, by Back or by its own close button, the next Back leaves the screen. A screen pushed over the one whose search is open still gets the press.
-
ui-bottom-sheettakes ascrimColorinput, the colour of the scrim that dims the screen behind the sheet on Android, such as a stronger one in dark mode or behind a sheet opened from another. (#2049, #2043)It is Compose's
scrimColor, converted as any colour is, and unset it leaves Material's default scrim. iOS takes no notice of it: SwiftUI has no scrim colour for a sheet. The sheet's own colour on Android is stillbackgroundColor, whichui-bottom-sheetalready passes as Compose'scontainerColor. -
A new app from
@ng-native/schematicsor@ng-native/nxignores its ownnode_modules/, where Vite and Vitest keep their caches. (#2063, #2056)In an Angular CLI workspace the root
.gitignorecovers only the root'snode_modules, so running an app's tests leftprojects/native/node_modulesuntracked. An app generated earlier can addnode_modules/to its own.gitignore. -
In an Android development build, a full reload no longer aborts the app with "Scheduler was destroyed with outstanding Surfaces" when LogBox is showing, as it is when an edit fixes a compile error. (#2052, #2045)
A full reload that
@ng-native/platformasks for (the hot reload's fallback for an edit it cannot patch, Metro's own full reload, andDevMenu.reload()) now first asks LogBox to hide and waits until React Native has stopped LogBox's surface, for a second at the most. React Native on Android dropped the stop of a surface that hid after a reload had begun, and its debug build aborted on the surface left behind. With no LogBox showing a reload does not wait. It applies in development on Android only: iOS, and release bundles, are unchanged. -
On Android with React Native before 0.88, a view that was disabled, such as a
<pressable>whose[disabled]goes back to false, is enabled natively again, so it takes presses on its background and is no longer announced as disabled. (#2046, #2040)React Native before 0.88 enables an Android view only when its
accessibilityStatesaysdisabled: false. On Android, when a view's last committed state saiddisabled: trueand its next one is gone or leavesdisabledout, the engine now sendsdisabled: falsewith whatever else the state says. This covers a component'sdisabled,aria-disabledandaccessibilityState, on components and on plain elements. It does so on every React Native version, so a test that renders as Android reads{ disabled: false }there instead ofnull. A view whoseeditableorenabledprop is false, or whosedisabledprop is true, such as a read-only text field, is not sent it. -
New apps get Expo 58.1, and
@ng-native/expono longer asks npm for anexpo-modules-coreof its own, which could put a second copy in an app. (#2060, #2053)@ng-native/expolistedexpo-modules-coreas a required peer, so an install with no lockfile could add a newer copy beside the oneexpopins, and an iOS or Android bundle held both. It now uses whatexpo, already a required peer, exports on SDK 57 and 58. An app that listsexpo-modules-coreonly for@ng-native/expocan remove it; an app that imports it itself keeps it.The templates,
ng add @ng-native/schematicsand@ng-native/nxwriteexpo~58.1.0, which Expo's version checks now expect. The generators keep a workspace's own Expo from 58.0.16 up to, but not including, 59 without a warning, and an Nx app generated beside a root that lists one takes the root's range. -
OS_SUPPORTnow has rows for more native controls and services, and marks the cells that describe a fallback. (#2039)fallbackOnlyon a row lists the OSes where the feature itself does not work and the cell says what happens instead. New rows include the date picker, segmented control and search field, which Linux draws too, and widgets, Live Activities and ongoing notifications, with the OS versions they need. A<modal>'sanchoris now marked ignored on iPadOS, and the communitymasked-viewhas a row of its own, as macOS and Linux draw it and do not drawsliderorpicker. -
The desktop template's README and
AGENTS.mdgive Linux packaging commands with the options they need, and say whatapp.jsonneeds first. (#2064, #2057)--format debstopped for want of--maintainer. Every Linux package needsexpo.description, and adeb, anrpmor a Flatpak needsexpo.ios.bundleIdentifier. -
A macOS or Linux desktop app can ship files inside its package with the
@ng-native/desktopplugin'sresourcesoption, and run a program among them. (#2047, #2041)Each resource is copied into the
.appor the Linux package, and a dev run links to it.{os}and{arch}in itsfromtake a build per target. Incapabilities.spawn, a program or a literal argument that starts with{resources}/is a file among them, wherever the app is installed, andProcesses.resourcesis their folder. On macOSpackagesigns each Mach-O file among them before the app, keeping the entitlements it is signed with butget-task-allow. A Mac App Store build still spawns nothing.An rpm no longer installs build id links, which two packages that ship the same program would both own.
-
A macOS or Linux bundle no longer prints Metro warnings that Expo's
package.jsonis invalid. (#2062, #2055)@ng-native/metro's desktop runtime named three of Expo's files with a.jsthat Expo SDK 58'sexportsadds too. Metro warned about each, then found the file another way, so the bundle itself worked. -
The
@ng-native/nx:sync-native-modulessync generator no longer adds a native module to an app when only a library's Node tests, their setup or its tools' root config files import it. (#2061, #2054)A library made by
nx g @ng-native/nx:libraryimports@ng-native/testingin its test and its Vitest config, and that package has native code. In an integrated workspace, an app that used such a library was out of sync:start,exportandprebuildcould stop in CI, andnx syncadded@ng-native/testingto the app'sdependencies, which links its native module into the app.A module counts as before when any other file of the library names it, or no file does. The files that do not count are
.testand.specfiles,test-setupfiles, and a tool's.configfile at the library's root, with any JavaScript or TypeScript extension. The generator only adds, so ifnx syncadded@ng-native/testingto an app'sdependencies, remove it there by hand.
❤️ Thank You
- Ashley Hunter
v0.31.0
🩹 Fixes
-
On Android, a shortcut on a key a scroll view scrolls with, such as Alt with an arrow key, fires while the focus is in the scroll view, unless text is being edited. (#2034)
The scroll view took the key first, so
shortcut="alt+ArrowDown"scrolled it to its end instead. With a modifier, a shortcut on an arrow key,Space,Home,End,PageUporPageDownnow goes before the focused view and the scroll views around it, and holding the keys down fires it once. Any other shortcut still goes after the focused view. -
On iOS with React Native's older animated module, a transform changed again and again and then taken away is drawn taken away, where the view could stay where it had been moved until something else in the app was animated. (#2033)
React Native uses that module unless
cxxNativeAnimatedEnabledis on, and Expo Go for SDK 58 has it off. A view whose transform, opacity or background is changed again within a second of the last change is handed to a native animated graph, which paints the changes after that. One that needs another graph, such as a transform with other entries or none, is now drawn with nothing else to animate, and so is a transform of nothing set on a view an animation has let go. The module draws when a value is set, when an animation starts, stops or runs, or when an event feeds a value, and making one of these graphs did none of those. Graphs driven by a scroll view are as they were. -
On macOS and Linux, a
<text>whose words are a fraction of a point wider than its box no longer draws on one line in a box two lines high. (#2037, #2036)Measuring broke the line, since the text did not fit, but drawing laid it out with half a point of slack (which keeps a line that fitted from wrapping in a box Yoga rounded down) and so fitted it on one line, leaving an empty line under it. The desktop host now draws a paragraph with the lines its box was measured for: when the layout with the slack is not the box's height, it takes the layout at the box's own width, or half a point under it, if that one's height is closer.
onTextLayout's lines are still read with the slack alone. -
On Linux,
<web-view>now shows a page, in a desktop host built from source where WebKitGTK 6.0 and its headers are installed. (#2038, #2035)Before, the Linux host mounted
react-native-webview's view as an empty box. It is now a WebKitGTK web view with the library's iOS events (loadingStart,loadingFinish,loadingError,loadingProgress,httpError,message,shouldStartLoadWithRequest,openWindow,contentProcessDidTerminate), its injected scripts and its commands, as the macOS host's is over WKWebView, andincognitokeeps a view's cookies and storage out of every other view's. The prebuilt Linux host has no web view, since it is built on AlmaLinux 9, which has no WebKitGTK 6.0: an app withreact-native-webviewbuilds its host from source, andnpm run linuxwarns when that build finds no WebKitGTK. A.debof a host that links WebKitGTK depends onlibwebkitgtk-6.0-4.Where WebKitGTK differs from WKWebView: a
source'smethodandbodyare not sent,loadingStartcomes as the page's load starts, and the app is asked about a frame's navigation as about the page's own, withisTopFrametrue, since WebKitGTK does not say which frame a navigation is in.originWhitelistapplies to a frame's page too. -
Children that change places while their number stays the same are laid out where they are now, where rows with the same layout styles stayed where they had been. (#2032)
This is a list sorted or put in another order by
@for, or children put in another order by the CSSorderof a flex container. The new order was committed, but React Native keeps the layout of a view given all its children in one call when their number and the layout style in each place are as they were. A view whose child list changes with its length the same, or whoseorderputs its children in another order, is now given them one at a time, as React's renderer gives them, which lays it out again. Any other change to a view's children still gives them in one call, so a child that is only drawn another way costs no layout.
❤️ Thank You
- Ashley Hunter
v0.30.0
🚀 Features
-
Prebuilt desktop hosts are now built for React Native 0.88.1 in place of 0.88.0, and
@ng-native/template-desktopand desktop-only apps from the generators get 0.88.1, so a desktop app still onreact-native0.88.0 builds its host from source until it moves to 0.88.1. (#1922)The CLI takes a prebuilt host only for the exact React Native version an app has, and 0.88.1 changes JSI and the Hermes version, so a 0.88.0 host cannot run an app on it. To keep using a prebuilt host, run
npx expo install expo@~58.0.24, thennpx expo install --fix, which movesreact-nativeto 0.88.1; an app that also runs on iOS then regeneratesios/withnpx expo prebuild -p ios --clean. Until then,ng-native-desktopbuilds the macOS host from source, and a Linux host only on Linux of the architecture it is for.make-prebuilt.mjstakes--react-native <version>to build a host against a version the app does not have. -
corner-shape: squirclenow gives a rounded corner Apple's continuous curve, on iOS and macOS, andborder-curve: continuousnow works on macOS as it did on iOS. (#2017, #2016)Before,
corner-shapewas dropped, and the desktop host never readborderCurve, so a view beside the system's own windows and controls had circular corners where theirs are continuous.roundis the circular corner. Android and Linux have no continuous curve and keep round corners, and any other shape is refused with a warning. -
scrollbar-color: transparent transparentnow hides a desktop scroll view's scroll bars and keeps their place, andscrollbar-color: autodraws them again. (#2014, #2013)A scroll bar shown only on hover used to move the content on a Mac set to always show scroll bars, or on a Linux desktop with classic ones:
scrollbar-width: nonegives the bar's strip to the content, so each hover laid the content out again. Hiding the bar withscrollbar-colorkeeps the strip, so nothing moves. The system colours a scroll bar, so any other colour is refused with a warning.
🩹 Fixes
-
On macOS, a presented
<modal>no longer commits its size again and again while it stays open, which kept one CPU core busy. (#1939, #1930)The modal's state update with the size it had just sent sent that size once more, so each commit started the next. A modal still sends its size when it opens, when its window resizes, and when its state holds a different one.
-
Scrolling a
<virtual-list>or<section-list>from an effect no longer makes the effect depend on the list's own state, which could run it again without end. (#1999, #1995)scrollToOffset(),scrollToIndex()andscrollToEnd()on a virtual list, andscrollToLocation()on a section list, read the list's signals. An effect that called one ran again when the list changed, such as when the user scrolled to other rows.scrollToOffset()andscrollToEnd()to rows that were not rendered failed with NG0103, "Infinite change detection".A scroll made from an after-render effect also replaces one the list queued in that render, which could come after it: back to the end of items that got shorter, or to hold its position with
maintainVisibleContentPosition.An effect now runs again only for the signals it reads itself. One that should scroll when the items change has to read them, such as
this.messages(); this.list().scrollToEnd();. -
A
<virtual-list>no longer undoes ascrollToOffset()orscrollToEnd()made in the handler that makes its items shorter. (#2002, #1998)The list gets its new items at the next render, and could then scroll back to their end, after the app's scroll. On Android this undid a jump (
animated: false) to an offset, and on iOS an animated scroll to one. The list now makes the app's scroll again after that render when its own would undo it, or when the app's was to past the new end. An animated scroll starts from the new end when the list was past it.The same goes for a list with
maintainVisibleContentPositionwhen the handler adds or removes rows above the ones on screen: a jump to an offset goes to that offset in the new items, and an animated scroll starts from the held position. -
In the dark scheme, a later rule with a
light-dark()in it now beats an earlier one of the same specificity, as in a browser. (#2021)Before, when two rules both used
light-dark(), the earlier rule's dark colour beat a plain colour the later rule set for the same property in the dark scheme. A.danger { color: red; background-color: light-dark(…) }after a.card { color: light-dark(black, white) }, for example, left the text white in dark mode. This applied to global, component and host sheets alike. -
On an iPad with a hardware keyboard, a
<pressable>, a<touchable-opacity>and any view with[focusable]="true"take the keyboard's focus with UIKit's focus halo, and Space or Return presses the focused one as a tap would, opening a[menu]from iOS 17.4, where React Native's iOS views take no keyboard focus. (#1948, #1900)Needs
@ng-native/components' pod: the views report themselves to itsNgNativeKeyboardFocusmodule, which Expo Go does not have. Tab moves the focus between focus groups and the arrow keys within one, as in other iPad apps. A disabled view is not focused. A press sends the touch a tap at the view's middle would, so(pressIn)and(press)fire as for a tap, and a press that opens a[menu]fires no(press), as a tap's does not. Full Keyboard Access, which moves the focus by its own rules, is not covered. -
On iOS 17.4 and later,
PressMenu.open()opens a<pressable [menu]>'s menu from code, and a tap made on the element before its menu is ready opens the menu instead of doing nothing. (#1901, #1830)A touch still opens the menu as it goes down, as SwiftUI's
Menudoes. From iOS 17.4 theNgNativeMenusmodule hasopenPressMenu(nativeID), and its constants say so withopensPressMenus; it does nothing while the menu is already showing. A tap that the element takes before the clear button that opens the menu is laid over it now makes the module look for the element's view at once and open the menu. Before, that tap did nothing, and for an element shown after it was mounted the button could take up to 2 s to be laid. Before iOS 17.4,open()still returns false, with one warning in development. -
On macOS, an inset content card (
contentStyle="inset") runs up to 8 points from the window's top in a window made withtitleBar: 'hidden'that has no toolbar, and a window whose sidebar has[toggleButton]="false"has no toolbar unless a header or history fills one. (#1944, #1908)Before, a window with a split view always had a toolbar for the sidebar button, so the card started below it, about 52 points down. The toolbar now shows only while it holds the sidebar button, a
<native-header>, or the back and forward chevrons. With a title bar that shows its title, or with a toolbar, the card still starts below them. Each window's toolbar also has an identifier of its own, so AppKit no longer carries one window's toolbar items into another's. -
@ng-native/web-compatnow sets a library's inline boxes among the words around them, as a browser does:If you use none, links would <button tuiLink>inherit text color</button> in tandemis one paragraph that wraps past the link, where each run of words was a line of its own and the link a line of its own between them. The box sits on the paragraph's baseline, a link's icon and its words stay on one line, and a<code>or<b>beside it is a span of the paragraph. That holds in a<p>and for words written straight into a block beside a box. A component with no selector in a directory given assources, as Taiga UI's examples are, is hosted by an inlineng-browser-component, laid out as a browser lays outng-component, where it was a native view. A component with no selector anywhere else keeps its nativeng-componenthost. (#1961)A
::beforeor::afterbox is inline until a rule gives it a display, as a browser's is, and a span that is an inline-block clipping what it holds, a line cut short with an ellipsis, is a box among the words. -
@ng-native/web-compatnow draws white space inside a run of text in HTML's text elements as one space: a value written over several lines, JSON in a<code>say, is one line of words, where its line breaks were drawn. Where one run ends with a space and the next starts with one, both are still drawn. A<text>keeps its line breaks, as React Native's does, and so does a<pre>and a text element in one,<pre><code>, as a browser keeps them. An empty inline box at the start of a line, a::beforewith no content, puts nothing there, so the space after it goes as at any line's start. (#1961) -
A desktop app no longer crashes in
PointerEventsProcessorwhen a hovered view is freed while its pointer ev...
v0.29.0
🩹 Fixes
-
On Android, a
scroll-vieworvirtual-listin a screen presented as aformSheetnow scrolls back up on a fresh drag, and anative-headerin one is no longer padded by the status bar's height. (#1873, #1649, #1648)Both default per screen: nested scrolling is on in a form sheet, as it is beside a
refresh-control, andconsumeTopInsetis off, since a sheet never reaches the status bar. A screen pushed in a stack inside the sheet gets the same defaults, and one presented over the sheet does not. Setting[nestedScrollEnabled]or[consumeTopInset]still wins.IN_FORM_SHEETfrom@ng-native/devicesays whether a screen is in a form sheet. iOS is unchanged. -
On Android, a
text-inputorswitchalready on screen now follows an in-place light or dark change: a field's selection colour, cursor and selection handles, and a switch's press ripple. (#1874, #1592, #1593)Before, they kept the colours of the scheme they were created in until the screen was made again. A
cursorColororselectionHandleColorset on the field stays, and so does aselectionColorunless it is the old scheme's own selection colour, which then follows the scheme. A switch withthumbColorkeeps the ripple React Native gives it, and one with abackgroundColorkeeps that background's ripple. The cursor and handles follow on Android 10 and later only. -
A
<pressable [menu]>now opens its menu on iOS, as a UIMenu from the element on a touch or a VoiceOver press, with checked items shown checked, instead of firing(press)with a warning. (#1829, #1818)It takes the
NgNativeMenusmodule's newsetPressMenu(nativeID, entries), which a development build has and Expo Go does not; in Expo Go a press still fires(press), with one warning in development. The module lays a clearUIButtonover the element's view, which UIKit opens the menu from, and takes it away while the pressable is disabled or once[menu]shows no item. UIKit has no way to open a menu from code, so on iOSopen()returns false, with one warning in development. -
Taking the
<native-tab>in front out of a<native-tabs-outlet>at runtime, with an@iffor example, now navigates to the first tab still in the bar, which comes in front with its page once its guards allow it, instead of leaving a blank screen. (#1891)The router navigates to where that tab was left, and keeps a page presented over the bar. When a guard on that tab refuses, the router stays on the removed tab's url. A tab taken out while a screen pushed over the whole bar is in front is not handled yet. A tab added again comes back where it was left. On Android, with react-native-screens 4.30, the removed tab's item still stays in the bar, as the native side never receives the removal.
-
A view the engine paints on native without a commit, one whose transform or opacity changes again and again, is left to one graph of React Native's animated module a prop. The painter lets the view go before a scroll drive or a scroll-driven animation that sets a prop it paints connects to it, as it already did for a native
@keyframesanimation, where both used to set its transform and the one native updated last was drawn. And a view a graph has moved before, such as a sticky row, has the change that hands it to the painter painted on native, where it used to be left to a commit, which iOS and Android do not apply to a prop a graph has set: a list row taken out of the pool of parked rows kept its parked transform, and was drawn off the screen, blank, at its place in the list. (#1843) -
A scroll drive or a native animation connected to a view whose transform or opacity the engine has set on native since a graph last let it go now lets the graph that set them go first. It used to let it go after, and React Native's C++ animated module, which keeps one graph a view, then forgot the new one too, so a commit could change the view under it. (#1888)
-
On iOS and Android a
<native-button>draws an icon's SVG markup,[icon]="{ svg }", before its label in the label's colour, and on Android it draws a bitmapdrawable, which it took and drew nothing for before. (#1841, #1805)iOS and Android draw the markup once as an image, through the renderer an SVG
<native-tab>icon uses:withSvgIcons(SvgImages)inprovideNativeRouter, or the newSVG_ICON_RENDERERtoken from@ng-native/devicein an app without the router. Without one the button shows no icon and says so once in development, where before it said that only macOS and Linux draw an SVG icon. On iOS the UIButton draws the image as a template image a symbol's height in the title's font, tinted as a symbol is, and an SF Symbol given too wins. The iOS button is native code in@ng-native/components, so the image draws in a development build and not in Expo Go.On Android the button lays its icon, an 18-point
<image>of the drawable or of the drawn markup, in a row before its label and tints it in the label's colour, black where none is set. The drawable is drawn through React Native's image view, so a PNG or WebP drawable draws and a vector drawable written in XML still draws nothing. A button with no icon is laid out as before. -
<expo-map>now takes the props and eventsexpo-mapshas on one platform only, and a Google marker'sicon. (#1877, #1549)On iOS,
annotationsand(annotationClick). On Android,mapOptions,userLocation,contentPadding,(mapLoaded),(mapLongClick)and(poiClick). A marker's or an annotation'sicontakes an image asexpo-image'suseImagereturns it and is sent as its shared object's id, asexpo-maps' own views send it. On macOS the desktop host draws no annotations. -
On macOS, enabled app-owned menu items can take Cmd-[ and Cmd-] from the standard View menu, whose Back and Forward commands remain clickable. (#1869, #1851)
-
On macOS, a streamed
fetchbody now delivers each chunk whole as it arrives. Before, the desktop host could hold back the last one or two bytes of a chunk until more data arrived or the request completed, which could delay a Server-Sent Events or NDJSON record until the next one. (#1865, #1847) -
screenshot(),toMatchScreenshot(),toHaveColorAt()andcolorsAt()now work in device tests on macOS: the desktop host has theNgNativeTestingmodule, which draws the app's window in process and asks for no screen recording permission. Where the module is missing, the error now says to update@ng-native/desktopon macOS, and that the Linux host does not have it yet, instead of telling you to rebuild a development build. (#1866, #1846) -
inheritset in an element's own style,style="width: inherit"or[style.width]="'inherit'", is now the parent's value, for the properties a stylesheet takesinheritfor, where native used to get the word itself. (#1884, #1879)These are the sizes,
color,background-color,opacity, the font and text properties a stylesheet inherits, the corner radii, and a border's widths, colours and styles. Any other property set toinherit,initial,unsetorrevertis dropped with a warning in development, as a stylesheet drops it.font-familykeeps the word as it did, and thebordershorthand set toinheritis still dropped. -
<expo-video>and<expo-live-photo>now have the view functions ofexpo-video's andexpo-live-photo's React refs. (#1876, #1548)On
<expo-video>,enterFullscreen(),exitFullscreen()andstartPictureInPicture()work on iOS and Android, andstopPictureInPicture()on iOS, whereexpo-videohas it. Each does nothing on macOS. Picture in picture needsallowsPictureInPictureand the config plugin'ssupportsPictureInPicture, and on Android a device that supports it. On<expo-live-photo>,startPlayback(style?),fullunless set, andstopPlayback()work on iOS. Each returns a promise, and does nothing before the view is on screen. -
<expo-blur-target>and<expo-blur [blurTarget]>give<expo-blur>on Android the content it blurs, asexpo-blur'sBlurTargetViewandblurTargetdo. (#1878, #1550)Register the target with
registerExpoViews('expo-blur-target'). On Android it isexpo-blur'sExpoBlurTargetView, and the blur commits its view tag asblurTargetId, which blurs with ablurMethodother thannone. On iOS and macOS the target is a plain view. An Expo view registration can now name no view for a platform, which commits a plain view there. -
Device tests run root effects in services created by rende...
v0.28.0
🚀 Features
-
Queries leave out what a tab behind the selected one in a
<native-tabs-outlet>holds, as the tab bar shows only the selected tab, so a test that found content on a tab behind no longer finds it. (#1806, #1783)To migrate, select the tab first, or pass
{ includeHiddenElements: true }to a query that means to reach a tab behind.The
<native-tab>itself, its item in the bar, is still found. A querywithina view on a tab behind finds nothing either. -
Queries leave out the screens of a native stack that a pushed screen covers, as React Native Testing Library leaves out what is hidden from accessibility, so a test that found content on a screen below the top no longer finds it. (#1780, #1767, #1769, #1752)
To migrate, query what is on the screen in front, or pass
{ includeHiddenElements: true }to a query that means to reach a screen below it.A screen under a push, a
fullScreenModalor acontainedModalis hidden, and on Android a screen under amodal(whatpresent()shows by default) or apageSheettoo, which Android shows full screen. Everything on a hidden screen is hidden,withinincluded, whether it starts from the screen or from a view on it, and so is what iswithina view under one hidden from accessibility. A screen under a sheet or a transparent modal is still showing, and still found, and so is one under amodalor apageSheeton iOS.
🩹 Fixes
-
A bound style ending in
!important,[style.width]="'10px !important'", is now read as its value. Before, Angular left a space where it took!importantoff, and the value reached native as the text'10px ', which it dropped. A bound style set to an empty string,[style.width]="''", now takes the declaration out, as a browser does, so a class rule for it applies again. Before, the empty value stayed in the inline style. A bound style that is only whitespace, other than a custom property, is dropped and the value it had is kept, as Chrome does, with a warning in development. A custom property bound to whitespace keeps a blank value that hides one of the same name from a class, as Chrome's--h: ;does. (#1445) -
userEvent.press,userEvent.longPressandfireEvent.presson a<ui-toggle>flip it, as a tap does on iOS, Android and macOS, where before they did nothing. (#1806, #1783)On iOS and macOS the press ends with SwiftUI's
isOnChange, the opposite of the boundisOn, or with none bound, of what the last press switched it to; one SwiftUI'sdisabledmodifier turns off sends none. On Android it ends with Compose'scheckedChange, the opposite of the value the switch shows. Either way(isOnChange)runs. -
userEvent.press,userEvent.longPressandfireEvent.presson a<switch>flip it, as a tap does on iOS, Android and macOS, where before they did nothing. (#1780, #1767, #1769, #1752)The press ends with the
changeevent the native switch sends, with the opposite of the value last committed, so(checkedChange),[(checked)]and a form field see the new value. A disabled switch sends none.fireEvent(node, 'change', { value })sets a given value. -
The Vitest plugin compiles a component's stylesheet for the
osit runs as, so a test checks CSS against that OS alone, as Metro does for the platform it bundles. (#1780, #1767, #1769, #1752)On macOS, Linux and Android a
filtersuch asgrayscale(1)is kept, where before it was dropped with the iOS warning, and an iOS project keeps askewX(), which only Android refuses. Awebproject's stylesheets are compiled for iOS and Android together, as before. The warnings a test run prints change to match. -
userEvent.press,userEvent.longPress,userEvent.type,userEvent.clearandfireEvent.pressdo nothing on a screen nobody can see, a native stack screen another covers or a tab behind the selected one, where before they reached a node found there withincludeHiddenElements. AuserEvent.pressoruserEvent.longPresswhose screen goes out of sight while the finger is down ends in a cancelled touch, with no press. (#1806, #1783)Content of an
@expo/uisheet or popover presented from such a screen still takes a press, as it shows in a window of its own. A node hidden only from accessibility still takes a press, as React Native Testing Library presses it. -
On macOS and Linux,
<sidebar-item>,<native-button>and a desktop<native-tab>take an icon's SVG markup, such as an@ng-iconsicon, as their icon:[icon]="{ svg: lucideBlocks }". (#1804, #1756)ButtonIconhas a third form,{ svg: string }, which the desktop host draws as its own icon: on macOS a template image AppKit tints for the selection, an inactive window and Increase Contrast, as it does an SF Symbol, and on Linux in the row's or the button's text colour. On macOS and Linux<sidebar-item>and<native-button>commit it as thesvgIconprop, and on macOS ansfSymbolset beside it wins.A
<native-tab [icon]="{ svg }">on macOS and Linux needs nowithSvgIconsrenderer, and commits its markup as adata:image/svg+xmlicon source, which the host draws as the icon of the tab's sidebar row.iOS, Android and the web draw no SVG button icon, and in development a
<native-button>says so once. Either element also says once when its markup is no<svg>element, such as an icon's name given in its place. -
A
<sidebar-item>with apaththat an@foror an@ifrenders no longer throws NG0950 at launch, and the route selects it as it does a static one. (#1777, #1750, #1755, #1757, #1758) -
A
shortcutonF13toF20now fires from a key press on macOS, Linux and, with a modifier as every Android shortcut needs, Android 16 and later, where before only a macOS menu item could use those keys. (#1809, #1798, #1786)The macOS and Linux hosts now name those keys in their key events, and the Linux menu bar shows them as accelerators. On Android,
F13toF20have key codes from Android 16 (API 36), where the Keyboard Shortcuts helper lists them by key code; an older Android's helper leaves them out. iOS still stops atF12, as UIKit names no key past it. -
A
repeating-linear-gradient(...)in a stylesheet now compiles to the tile that draws the same stripes, one linear gradient withbackground-sizeandbackground-repeat, where it used to be dropped with a build warning. (#1782, #1770, #1774)The lowering takes stops in
pxorrem, the first at 0 or with no position and the last with one, and a direction that is an angle or a side, on iOS, Android, macOS and Linux. Percentage,emand viewport stops, a first stop not at 0, a corner direction, and abackground-sizeor abackground-positionin lengths written beside it in thebackgroundshorthand are still dropped with a build warning, which now names the tile to write instead. Avar()in a repeating gradient, a token holding one, andrepeating-radial-gradientare dropped with a warning as before. The tile sets that layer's background size, position and repeat.The build error for a component whose
stylesorhostis imported from another file now says what to write instead: a.cssfile instyleUrlorstyleUrlsfor styles, and bindings in the same file or a directive inhostDirectivesfor a host. -
A
repeating-linear-gradient(...)along a side with percentage stops now compiles to a tile that percentage of the box, a period inpxorremunder 1px is dropped with a build warning, and an ordinary background image that wins over a repeating gradient no longer takes the tile's size, position and repeat. (#1815, #1785)Percentage stops are lowered only along a side (
to bottom,to right,90degand the like) and only when every positioned stop is a percentage or 0; at any other angle, or mixed withpxorremstops, they are still dropped with a warning. A repeating gradient'sbackground-imagewritten after abackground-size, or abackground-positionin lengths, in the same rule is now dropped with a warning, as it already was beside them in thebackgroundshorthand, where its tile used to replace the author's placem...
v0.27.0
🚀 Features
-
Linux is an OS that the packages, the Metro preset and tests know of, ahead of the Linux desktop host. (#1712)
OS_NAMES, theOStoken,TestOsandModulePlatformgain'linux', so aswitchorRecordthat covers every OS needs alinuxentry. Theos-comparisons-on-linuxmigration notes the=== 'ios',!== 'ios',=== 'macos',!== 'macos'and!== 'android'comparisons it finds in an app, with their file and line, and rewrites nothing; see Updating an app. There is no Linux desktop host yet, so a Linux app does not run.On Linux,
DESKTOPis true andAPPLEfalse, thelinux:anddesktop:Tailwind variants matchplatform-linux, and<code>andfont-monousemonospace. The CSS compiler builds a sheet forlinuxalone, with the filters iOS does not draw refused as on macOS.expoModule()answers the desktop host's modules there and never calls an Expo loader, and a missing one says to runnpm run linux. Vibration is absent, sharing uses the desktop host's module, windows restore from React Native'sSettingsas on macOS,Alert.promptis available, and the Dock and tray menus readmodas Ctrl.@ng-native/metroregisterslinuxwith Expo SDK 58, which does not know it, for an app whoseexpo.platformslists it: alinuxbundle resolves.linux, then.ios, then.nativefiles, takes React Native's iOS code, answersPlatform.selectfromlinux, thenios,nativeanddefault, and installs formatjs'sIntlpolyfills with English data and every time zone, since the Linux host's Hermes has noIntl.expo export -p linuxalso needsrequire('@ng-native/metro/linux.cjs').registerLinux(__dirname)inapp.config.js. In@ng-native/eslint-plugin, a desktop event is allowed in a project that listslinux, and its messages say "a desktop OS" rather than macOS. -
linuxLauncher()now runs the host with a fake system UI by default, which needsdbus-daemonandpython3with PyGObject where the host runs: a launch without them fails with status 70, so install them or passfakeSystemUi: false. (#1712)The fake system UI is a session bus of the launch's own with a fake desktop portal for the FileChooser, OpenURI and Notification portals, so a request to one of those portals shows no dialog and waits for no one. The fake cancels a file chooser and opens a link unless a test writes an answer to
portals/answers.jsonin the run's state folder, and it records every call to those portals inportals/calls.jsonl.fakeSystemUi: falseruns against the session's own portals. With the fake, a container (the default off Linux) starts as root, whatever user its image names, adds a passwd entry for your user if the image has none, and runs the session as your user, as the bus requires. Where the host runs without a container of the launcher's, your user needs a passwd entry.
🩹 Fixes
-
A transform bound as a string is read in about half the time it was, and a number in one with a sign, an exponent or its unit in capitals is now read as a number. (#1712)
[style.transform]="'translate(' + x + 'px, ' + y + 'px)'"is read again every frame of an animation driven from JavaScript, and every bound style with a bracket in it is checked faster for brackets left open.translateX(+4PX)orscale(1e-1)is now the number a stylesheet's transform gives; before, it reached native as text, which native does not read. A length where a number or an angle goes, as inscale(2px)orrotate(2px), is now dropped, as Chrome drops it, rather than read asscale(2)or a rotation of 2. -
A view whose bound
opacity,transformorbackground-coloris all that changed since its last commit can have that value patched into what it committed, instead of every prop being merged again. (#1712)Bound as
[style.opacity],[style.transform]or[style.backgroundColor], as a frame of an animation driven from JavaScript changes them: a frame that moves and colours 2,000 views costs about a quarter less, and one that only fades them about a third less. The view is still merged in full where anything else on it changed, a transition or animation is declared anywhere in the app, an!importantrule or a component'sstyleOverridesets the value, the view is hidden or clipped away, its parent paints its background on it, a transform comes or goes (which can make or unmake it what its absolute children are placed against, where its position or a filter does not already), or the transform is one the patch does not read, such as one inemorcalc(). Where React Native's animated module paints views (iOS, Android, and now macOS and Linux), what the commit's walk has it paint is sent in one batch rather than one a view. -
On the GTK desktop host on Linux,
AppInfo,LocaleandCryptohave a source of their own.AppInforeads a package's version, build number, id and name from itsmetadata.json, which now carries the build number asCFBundleVersion, and its device facts from the firmware (the maker as the brand), the distribution'sos-releaseand the kernel.Localelists the languagesLANGUAGEand the messages locale name, with the separators, currency and measurement system of the locales the formats are set to, and the calendar's time zone, clock and first weekday; it no longer answers English in the system's region.Cryptodigests with GLib (SHA-1, SHA-256, SHA-384, SHA-512 and MD5; MD2 and MD4 answer nothing) and takes random bytes from the kernel. On macOS, Device's brand is still Apple; on another OS it is no longer Apple but the machine's maker. (#1712) -
On Linux a view's
accessibilityActionsreach a screen reader over AT-SPI, listed beside its press ascustom.<name>(GTK gives AT-SPI no label for an action), and invoking one sendsonAccessibilityActionto a view that listens, as on macOS. (#1712) -
On the GTK desktop host on Linux, a crash writes
crash.txt, naming the signal and the native stack, to the test launch's state folder or to$XDG_STATE_HOME/<app id>/, and prints it to standard error. A dev run or test launch playsNGN_INPUT_SCRIPTinto its first window under X11 (Xvfb included) through XTest: the pointer steps,keyandtype. (#1712) -
On Linux,
Appearance.getColorScheme()and@media (prefers-color-scheme: dark)follow the desktop's light or dark style, from launch and as it changes. (#1712)Before, they started light whatever the desktop's style and did not follow it as it changed, so an app drew its light colours over libadwaita's dark chrome. Only
Appearance.setColorSchemechanged what they answered. -
On the GTK desktop host on Linux, an alert with more than three buttons, such as
Dialogs.choosewith four choices or more, stacks its buttons one above another, as libadwaita does when they do not fit side by side, where short labels sat in one row before. (#1712) -
On the GTK desktop host on Linux,
<expo-camera>,CameraandImagePicker's camera work through the Camera portal, PipeWire and GStreamer 1.22 or later, with GStreamer's PipeWire plugin installed. (#1712)Access is the portal's
AccessCamera, and whether there is a camera is itsIsCameraPresent. A picture is the newest frame, as a JPEG or PNG. A recording is a QuickTime movie, H.264 where an x264 or OpenH264 encoder andh264parseare installed and Motion JPEG otherwise, with AAC sound where an AAC encoder is installed, the view is not muted and a microphone is present: PipeWire records silence with no error when there is none, so a recording without a microphone has no sound track. A camera starts off the main loop, and one whose stream fails after it started sendsmountError.facingandmirrordo nothing, since the portal offers the cameras as one.ImagePicker.launchCameraAsyncshows a camera window over the app's front window with the preview, Cancel (or Escape) and the shutter, which waits for the camera's first frame, and a Photo and Video switch when both are asked for; a recording cancelled there leaves no file. -
By default, building the desktop host from source on Linux compiles it with clang, as it already compiled Hermes and ICU. (#1712)
Before, CMake took the system's
ccandc++, which is GCC on most distributions, and the build failed on React Native's#pragma mark.CCandCXX, where set, are left for CMake to read, flags and all. The toolchain check before a Linux build no longer prints unzip's usage text to the terminal. -
On Linux, a dev run with
NGN_LOG_COMMITS=1also logs each window's frames as[ngn] frame N ms, the time from the start of the GTK frame clock's update to the end of its paint, beside each commit's time. (#1712) -
On the GTK desktop host on Linux,
Batteryreads UPower's display device and whether the machine runs on battery, with low power from the PowerProfileMonitor portal or power-profiles-daemon, and has no battery where UPower does not answer;Networknames Wi-Fi, Ethernet or cellular from NetworkManager's primary connection, andOTHERwithout NetworkManager; andLocationtakes fixes and watches through the Location portal (GeoClue behind it), whose answer at the first start is the permission, restricted where no Location portal answers. Geocoding stays absent on Linux. ([#1712](https:...
v0.26.1
This was a version bump only, there were no code changes.
v0.26.0
🚀 Features
-
vitest --project iosandvitest --project androidstart Metro, build the app's development build, boot the simulator or emulator and launch the app themselves, as--project macosstarts the desktop host, so device tests run with one command locally and on CI. (#1715)The build is made the first time and kept in
node_modules/.cache/ng-native-device-testsby the project's native fingerprint (@expo/fingerprint), so later runs take seconds and a CI job can cache it.deviceTests({ device })names the simulator (iPhone 17 Pro) or emulator (its AVD name), booted when it is not running; without it a run uses one that is running, or the newest iPhone or first emulator. Each launch starts the app with no data of an earlier one: reinstalled on a simulator, its data cleared on an emulator.Before, an iOS or Android project waited for an app opened by hand, loading from a Metro started by hand.
deviceTests({ launch: false })keeps that. A macOS run also starts its own Metro now, on a free port, instead of loading from the one onRCT_METRO_PORTor 8081;deviceTests({ metroPort })points a launched app at a Metro of your own.An app the pool launches, on any OS, has ten minutes to connect by default instead of 60 seconds, since the desktop host builds itself on its first run; one that exits still fails the run at once, and stopping Vitest during a build stops the build.
A device project gives each test 30 seconds unless its config sets
testTimeout, since a first render on a simulator just booted, as on CI, can take several, and a run prints what it is doing (booting, building, installing, waiting for Metro) with how long each took.A project with no
iosorandroidfolder is prebuilt for the build, with itsapp.json,app.config.*andpackage.jsonput back afterwards, so a test run leaves no change in the project's sources beyond the generated folder.
🩹 Fixes
-
A desktop host built from source builds in one directory at a time: a second
ng-native-desktopcommand that builds the same host waits for the first, printing that it is waiting, instead of building beside it and leaving its build log corrupt, which made the next build recompile hundreds of objects with nothing changed. (#1719) -
CSS animations played natively that end in the same frame now share one commit, rather than each committing the whole tree as it ends. (#1717, #1714)
Where the platform drives the engine, an animation's end marks its view and the next frame commits it, so a list of labels fading in together costs one commit as they finish. An engine with no host to schedule a frame still commits as each one ends.
-
<virtual-list>and<section-list>now render ahead of a fast scroll, and take avelocityLeadinput that sets how far. (#1669)While the list scrolls, the window reaches past the viewport in the direction of the scroll by about the distance the list covers in
velocityLeadmilliseconds (500 by default) at its recent speed, in steps of a quarter viewport and up to three viewports, so a fling lands on rows already drawn. The reach drops back as the scroll slows, and 200ms after the last scroll event. The first scroll event after ascrollToIndex,scrollToOffsetorscrollToEndcall does not count toward the speed. Later events do, including those of an animated scroll. More rows are rendered during a fast scroll than before.velocityLeadof 0 keeps the previous window. -
Where native moves sticky rows, a jump with
scrollToIndexpast a sticky row now pins the row it lands under at once, rather than at the next scroll, and leaves no gap where a plain row took the slot of a sticky one: a sticky row's slot now goes only to another sticky row. (#1652) -
<virtual-list>and<section-list>no longer mark the screen holding them for change detection on every scroll event. (#1671)The list used to listen for scroll events as an Angular host listener, which marks the list and every view above it for checking on each event, so a fling checked the whole screen every frame. Now a scroll event checks only what its signals change: the window when rows come and go, and sticky rows while one is pinned. A
(scroll)or(endReached)handler bound in a template still runs and still updates its view. A plain field written outside Angular's events that only showed up because the list scrolled now waits for the next change detection, as it does anywhere else in a zoneless app. -
<virtual-list>lays items out in columns with[virtualListNumColumns], asFlatList'snumColumnsdoes, spaced by[virtualListColumnGap]. (#1653)A line is as tall as its tallest item, a sticky row takes a line to itself, and the first column is on the right in a right-to-left layout. Columns apply to a vertical list with
itemHeight. -
Device tests can compare what the app drew with a reference screenshot:
await expect(node).toMatchScreenshot('name')captures a node, a region of the window orscreen(the whole window) on an iOS simulator or an Android emulator (Android 8 or later), and compares it with__screenshots__/<test file>/<name>-<platform>.pngbeside the test. A missing reference is recorded, except on CI;-urecords them all again. A pixel fails the match when a channel moves by more than one step of 255, the most an iOS simulator varies between runs, unlesscomparatorOptions(channelTolerance, where 0 is exact,threshold,allowedMismatchedPixels,allowedMismatchedPixelRatio) say otherwise, indeviceTests({ screenshots })for the project or in the call. (#1715)The capture comes from a native module in
@ng-native/testing: the development build a test run makes has it, and a development build made by hand before the upgrade needs rebuilding once. Expo Go and macOS do not have it, and a screenshot there fails with a message saying so. -
An app's engine in
@ng-native/platformis let go when the app is destroyed, as when Android recreates the activity after the font or display size changes, rather than kept for the rest of the app's life. (#1706)The old engine stayed joined to the runtime's shared event dispatcher, so it kept itself, its root and every view it had committed, and it was handed the events that have no target in place of the app that replaced it. It now leaves the dispatcher, cancels the frame and the timers it had asked for, and stops the animations and transitions native was playing for it, whose end callbacks native would otherwise go on holding, along with what native painted for it and the scroll-driven animations (
animation-timeline: scroll()) it drove.A closed window's engine does the same.
The dispatcher in
@ng-native/fabricno longer keeps the first engine that joined it once that engine has left. -
releaseOnDestroyin@ng-native/componentsand@ng-native/components/reanimatedwraps a function a worklet calls back, such as ascheduleOnRNtarget, so that native code keeping the worklet does not keep the component too. (#1707)react-native-worklets keeps such a function from native code after the gesture is detached, so one that reached its component kept the component and its view tree for the rest of the app's life. The function
releaseOnDestroyreturns calls the one it was given until the component, or theDestroyRefpassed to it, is destroyed, and then does nothing.The stand-in document that
mountin@ng-native/platformgives Angular no longer keeps the last app reachable after it is destroyed, so a component that arender()in@ng-native/testinghas unmounted can be garbage-collected, with its engine and fake Fabric. -
@ng-native/deviceexportsOS_NAMES, the OSes Angular Native runs on, andOsName, the type of one of them. TheOStoken,ShortcutOs,TestOsin@ng-native/testingandModulePlatformin@ng-native/expoare that type, so the next OS is added in one place. (#1556)An OS the host reports that is not in
OS_NAMESis now an error that names it, whereOSand the keyboard shortcuts used to read it as iOS. In a test, anNG_NATIVE_TEST_OSor a Vitest presetosoutside the list fails the same way rather than testing as iOS. iOS, Android, macOS and the web host answer as before. -
nx g @ng-native/nx:tailwindcan now wrap an app's Metro config inwithTailwindwhen its onemodule.exportsspans more than one line, as a newly generated app's does once it is formatted. Before, it warned it could not updatemetro.config.jsand still added theapp.tailwind.jsimport tosrc/main.ts, so the app's typecheck and bundle failed on a sheet nothing built. Where it cannot wrap the config, it now leavessrc/main.tsas it is too, and its warning names both steps to take by hand. A config that exports aconstalready wrapped inwithTailwindis left as it is, and one with awithTailwindof its own is left to be wrapped by hand. (#1726) -
The macOS desktop host no longer requests a react-native-svg
<image>again on each redraw after its request failed or its data was not an image, so a broken image stays blank while the app runs, as in a browser. (#1691)An
<image>with a path that the file boundary refused is still checked on...
v0.25.0
🩹 Fixes
-
@ng-native/platformand@ng-native/webwork with Angular 22.3, which removed the internalɵsetLocaleIdthey called at mount. On 22.3 a web app's Vite build failed with"ɵsetLocaleId" is not exported by @angular/core, and a native app threw when it mounted. On 22.3 a template's plurals readLOCALE_IDfrom the app's injector, so an app'sLOCALE_IDstill picks the plural rules there, as it does on 22.2 and earlier. (#1587) -
On Android, a
<switch>on screen now follows a change of scheme, by the system's dark mode or byColorScheme.seton Android 12 and later, once the app is rebuilt. (#1578, #1568)React Native's switch takes AppCompat's thumb and track tints from the theme once, when it is created, and an activity that handles
uiModeitself, as Expo's does, keeps its views across the change, so the off track could vanish against the new background. TheNgNativeColorSchememodule now tints each AppCompat switch in the activity again after each configuration change it takes in place. AthumbColorortrackColorset on the switch is kept. A switch whose theme gives it drawables other than AppCompat's is left alone, as AppCompat never tinted those. Expo Go keeps the old behaviour. -
With
@ng-native/web-compat, a root service that listens on the window no longer throws as the last app that asked for the package is destroyed. The package's own teardown runs before the destroy hooks of the services the app made after it, and it took the window'saddEventListener,removeEventListeneranddispatchEventaway, so a service that listened withfromEvent(window, 'resize')andtoSignalortakeUntilDestroyed, as Taiga UI's root does, failed to take its listener off, and rxjs threw anUnsubscriptionErrorfromApplicationRef.destroy()and@ng-native/testing'scleanup(). (#1421)Those three now stay on the window once the last app has gone, where
withWebCompatgave the window no stand-ins of its own (in a test, or a Metro config without it); where it did, the stand-ins are put back as before. Every listener added to the window while an app was up still goes with the last app, so taking one off afterwards finds nothing left to remove, and a listener added after the last app has gone is kept for the next app, as the stand-ins keep one. The rest of what the package adds is still taken away. -
With
@ng-native/web-compat, a stylesheet's selector of thestyleattribute, such as[style],[style*=top]or:not([style*=top]), now matches thestyleattribute's text as a script writes it throughelement.style(a property by name,setProperty,removePropertyorcssText) or withsetAttribute, and matches again each time it changes, as Chrome does. It matched none of that text before, so a library's rule such as Taiga UI's:host:not([style*=top])kept its element hidden after the library positioned it. (#1419)An empty
styleattribute, whichcssText = ''or removing a script's last property leaves, still matches[style], andremoveAttribute('style')stops it matching where a template sets no style on the element, as in Chrome. A copy made withcloneNodematches by the attribute it was copied with. Once a script takes away every declaration it wrote, the view'sstyleprop is removed rather than left as an empty object. A style a template sets, in astyleattribute or with a binding, is still not part of the attribute's text. -
@ng-native/web-compathasprovideEventPlugins(), from@ng-native/web-compat/event-plugins, which runs Angular's event-manager plugins (EVENT_MANAGER_PLUGINS) for an app's listeners. A listener whose name a plugin claims is attached by that plugin, as it is in a browser, so Taiga UI's tabs, which listen fortui-tab-activate.stopthrough@taiga-ui/event-plugins, now switch when a tab is pressed. Before, such a listener heard nothing. A plugin that claims every name, as Angular's own DOM plugin does, is left to the renderer.@angular/platform-browseris an optional peer dependency of the package, needed only for this entry point. (#1429) -
With
@ng-native/web-compat, Angular's DOM adapter (getDOM()) is now set once an app that asked for the package is up, where the app has set none of its own, so Angular'sMetaadds, finds, updates and removes its<meta>tags in the document's head, anddocument.titlereads and writes the first<title>, which Angular'sTitlesets. (#1422)getDOM()was null under Angular Native, soMeta.addTag(),updateTag()for a tag not yet there andremoveTag()threw, as did code that calls them, such as Taiga UI'sprovideTaiga()for its font scaling, andTitle.setTitle()wrote a property no<title>element held. The adapter creates elements and documents, dispatches events and adds and removes listeners, removes an element, finds the window, the document and the body, and answers the user agent and the path of a<base href>in the head. It finds no shadow root and no cookie. Angular takes a DOM adapter once and never gives it back, so this one stays once the last app has gone; it keeps nothing of an app, reading the globaldocument, which is the newest app's, each time it is asked. An adapter the app has already set is left alone. -
With
@ng-native/web-compat, the document'sgetElementsByTagName,getElementsByTagNameNS,getElementsByClassName,getElementsByNameandgetElementByIdnow find<html>and<head>, as Chrome does, sodocument.getElementsByTagName('head')[0]isdocument.headandgetElementsByClassName('dark')finds a theme class on<html>. (#1420)They answered no
<html>and no<head>before, which made code such as Taiga UI'sprovideTaiga()and Angular'sMetathrow when it readgetElementsByTagName('head')[0]. The elements come in the orderquerySelectorAllgives them, sogetElementsByTagName('*')andquerySelectorAll('*')hold the same elements in the same order:<html>, then the head and what it holds, then the page. A head a script has put in the page comes where it is in the page instead. The lists stay live: a class added to or taken off<html>or<head>changes what they hold. An element's owngetElementsBy*still finds only what is under it. -
<virtual-list>and<section-list>now render ahead of the scroll while the JS thread is idle, so a fast fling lands on rows already drawn, and take awindowSizeinput that caps how far. (#1639, #1627)The window used to be the visible rows plus
overscanrows on each side, so a fling outran it and showed blank space. Now, once window changes stop for 50ms, the window grows a viewport at a time, ahead of the scroll direction first, up towindowSizeviewports in all (5 by default;FlatListdefaults to 21): about two thirds of the extra viewports ahead of the scroll and the rest behind. When the scroll turns, what was ahead is cut back to what is kept behind.scrollToIndex,scrollToOffsetandscrollToEndto a row outside the window start the fill over, so a jump renders one viewport, not the whole filled window, in one pass. More rows are rendered than before, and each window change costs more change detection once the window is full.windowSizeof 1 keeps the old window. -
withAngularNativetakes an experimentalcompilation: 'ngp', which compiles components with Angular's hybrid compiler (a Rust analysis pass in front of Angular's own template compiler) in place of oxc, as Analog'scompilation: 'ngp'does. (#1570)It needs Angular 22.2 or later.
@ng-native/metroships a build of@angular/ngpuntil Angular publishes it, and an app's own copy wins. Templates and the app's TypeScript are type-checked with TypeScript 7's language server as they compile, which needs@typescript/native-preview;disableTypeChecking: trueturns it off, andtsconfignames the file to analyze. The default stays'oxc', and nothing changes for an app that does not opt in. -
On macOS and iPadOS, where the app's menu bar is drawn, a
<menu-group>named as a default menu (such aslabel="File") with nomenuRole, which is drawn as a second menu of that name, now logs a warning saying so, and thatmenuRole="file"adds its items to the File menu instead. (#1613) -
SegmentedControlandDateTimePickerfrom@ng-native/exporegister their element the first time one is made, so an app that imports one no longer needs aregisterNativeViews('segmented-control')orregisterNativeViews('date-time-picker')call, without which the control drew nothing and nothing warned. On iOS the library still has to be installed; on macOS the desktop host draws both with no library installed. (#1609) -
On macOS
text-decoration-line: line-through(andtextDecorationLine: 'line-through'or'underline line-through') now draws a line through the text, which it never did, and an underline or a line through takestext-decoration-colorand adouble,dottedordashedtext-decoration-style. (#1611) -
On macOS
align-items: baseline(andalignItems: 'baseline') now lines text up by its first baseline, as on iOS, rather than by its top, and<text>sends(textLayout)with its lines, each where it is drawn, wh...
v0.24.0
🩹 Fixes
-
Camerafrom@ng-native/expo/cameragains amuteinput that sets<expo-camera>'smuteprop, and the macOS desktop host now honours it, so a muted view records with no audio track on iOS, Android and macOS. (#1540, #1537)A bare
muteattribute is true, andnullorundefinedleaves the prop unset, with sound. Before, a baremutecommitted an empty string, which no platform reads as true, and[mute]did not compile. On macOS the view'smuteasrecord()starts holds for that recording; a change while it records applies to the next one. As in expo-camera on iOS,record()no longer reads amuteoption of its own on macOS, which was never part of expo-camera'sCameraRecordingOptions. -
ColorScheme.seton Android 12 and later, in an app rebuilt with this release of@ng-native/components, also sets the app's night mode throughUiModeManager.setApplicationNightMode, so native views created after the change, such as Compose sliders, use the chosen scheme instead of the system's. (#1566, #1563)React Native's
Appearance.setColorSchemesets only AppCompat's default night mode, which the system overwrote on activities that handleuiModethemselves, as Expo's do, while the CSS kept the chosen scheme. The newNgNativeColorSchememodule ships in@ng-native/componentsand needs a native rebuild; Expo Go keeps the old behaviour. On Android 12 and later the system now keeps the scheme across launches untilset()orset(null)changes it; iOS and earlier Android are unchanged. -
@ng-native/expogains typed components for<expo-video>,<expo-blur>,<expo-gl>,<expo-mesh-gradient>and<expo-live-photo>,Cameratakes all of<expo-camera>'s view props as inputs, andMapViewalso types<expo-maps-apple>and<expo-maps-google>, so a boolean prop written as a bare attribute commits as true when the component is imported. (#1546, #1542)ExpoVideo,ExpoBlur,ExpoGL,ExpoMeshGradientandExpoLivePhotoare on the bare@ng-native/expoimport. Each input is the module's own view prop, typed, and goes to the view as it is, except thatExpoVideo'splayertakes avideoPlayer()as well as its id and commits the id. A boolean input written bare is true,nullorundefinedleaves the prop to the view's default, and an input left unset commits nothing, except where the module's React component sends a default of its own:ExpoGL'smsaaSamplesis 4 unless set on iOS, asexpo-gl'sGLViewsends it. Without the component imported, a bare boolean attribute still reaches native as an empty string, which iOS, Android and macOS each drop for a boolean prop.Camera's new inputs arefacing,flash,zoom,mode,mirror,autofocus,active,videoQuality,videoBitrate,animateShutter,pictureSize,selectedLens,enableTorch,videoStabilizationMode,barcodeScannerEnabled,barcodeScannerSettings,responsiveOrientationWhenOrientationLockedandratio.flashandautofocusare now committed asflashModeandautoFocus, the props the native view reads, asexpo-camera'sCameraViewrenames them; before,flash="on"andautofocus="on"on the element reached no native prop.flashModeandautoFocusstill work, as inputs, andflashorautofocuswins when both are set.flashis committed asoffunless set, asCameraViewsends it, so an iOS camera withCameraimported no longer fires the flash automatically by default; setflash="auto"for that.MapView's shape colours also take a number, a colour React Native'sprocessColoralready returned, asexpo-maps' own types do, and pass it to native unconverted. A template that importsCameraand binds one of these props to a value of the wrong type now fails to compile under strict template checking. -
Tab and Shift-Tab on the macOS desktop host pass over a disabled native control (a button, switch, segmented control or date picker) instead of moving the focus onto it. (#1525)
AppKit's
makeFirstResponder:focuses a disabled control all the same, so the host now checks that the control is enabled before moving the focus there, and Tab goes on to the next view in order. -
On macOS, text with no
textAlign, in<text>and in a<text-input>and its placeholder, aligns to the layout's leading side as on iOS, rather than by its script or the system's language. (#1545, #1543, #1544)<text>with notextAlignin a left-to-right layout now aligns to the left, where a paragraph that starts with a right-to-left script (Hebrew, Arabic) used to align to the right; a justified paragraph's last line still follows its own script. A<text-input>, single line or multiline, used to take AppKit's natural alignment from the system's language and ignoretextAlignandwritingDirection. With notextAlignits text and placeholder now align to the right whenI18nManager.isRTLis true and to the left otherwise. AtextAlignthat is set on a<text-input>applies as React Native iOS applies it, not turned round in right to left:auto,startandleftalign to the left,endandrightto the right, andcenterandjustifyas named. That differs from<text>, where right to left putsautoandstarton the right andendon the left and swapsleftandright, as on iOS.writingDirectionsets the field's base writing direction. -
On macOS, an app's views now lay out right to left whenever
I18nManager.isRTLis true (a right-to-left system language, unless the app callsallowRTL(false), orforceRTL(true)), as on iOS, where they laid out left to right inside window chrome AppKit had mirrored. (#1531, #1515)In a right-to-left window
--safe-area-inset-titlebar-leadingmeasures the close, minimise and zoom buttons from the right edge, where AppKit puts them, and a secondary click on the back chevron, which a right-to-left toolbar puts on the right, lists the back history rather than the forward one. -
On macOS,
<text>in a right-to-left layout is aligned as on iOS, and the trackpad's back and forward swipes turn round when the app lays out right to left. (#1541, #1533, #1534)In a right-to-left layout,
<text>with no alignment,autoorstartaligns to the right whatever its script,endaligns to the left, andleftandrightswap, where text used to align by its own script and keepleftandrightas they are. In a left-to-right layout an alignment ofautoorstartthat is set aligns to the left, as on iOS. A text input's text and placeholder are unchanged. WhenI18nManager.isRTLis true, a two-finger or three-finger swipe to the left goes back and one to the right goes forward, as Safari's do, and the screen in front of a native stack follows the fingers to the left during an interactive back swipe. -
On macOS the desktop host draws SVG
text-anchor(start, middle and end) and text along a<textPath>, where it drew all text start-anchored and drew nothing on a path. (#1520, #1508)Anchors apply per text chunk, as in Chrome: a span with its own
x, or off a path its owny, starts a chunk, anchored by its owntext-anchor; on a<textPath>a span'syplaces nothing and starts no chunk. On a path each glyph (a grapheme cluster, drawn as its run shaped it, kerning and joined forms kept) is placed at the point its middle reaches, turned with the path, fromstartOffset(a length or a percentage of the path), withside="right"setting it along the path reversed; a glyph whose middle falls off the path is not drawn. A<tspan>'s or<textPath>'sopacitynow applies once to all the text it holds. A character'sx,y,dxanddycome from the innermost element that sets them for it, as in Chrome, so a<text>'sdxanddyreach the first glyph on its<textPath>and a<tspan>with no characters places nothing.methodandspacingare not read, and<foreignObject>content still does not draw. -
On macOS an svg draws the views in a
foreignObjectat itsxandy, cut to itswidthandheight, and draws them again when a commit changes one of them. (#1532, #1522)As react-native-svg does on iOS, they are drawn from their layers in the object's place among the shapes, under the transforms, opacity, clip paths, masks and filters around it, so they take no clicks. What a layer does not draw into its own contents, such as a video or a visual-effect (glass) view, does not show.
-
On macOS
<dom-component>renders its DOM component in the desktop host's WebKit web view, with its inputs and outputs bound as on iOS, from the dev server in development and from thewww.bundlethatng-native-desktop packagewrites into the app'sResourcesin a packaged app. (#1528, #1509) -
On macOS
ImagePicker.capture()from@ng-native/expotakes a photo with the d...