Skip to content

Releases

v0.32.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 16:44

🩹 Fixes

  • On Android, a text's maxFontSizeMultiplier now 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 lineHeight by the whole system text size while it caps fontSize, 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. A text-input's line height is not changed.

  • On Android, hardware Back (or the Back gesture) now closes a native-search-bar open in a native-header before 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-sheet takes a scrimColor input, 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 still backgroundColor, which ui-bottom-sheet already passes as Compose's containerColor.

  • A new app from @ng-native/schematics or @ng-native/nx ignores its own node_modules/, where Vite and Vitest keep their caches. (#2063, #2056)

    In an Angular CLI workspace the root .gitignore covers only the root's node_modules, so running an app's tests left projects/native/node_modules untracked. An app generated earlier can add node_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/platform asks for (the hot reload's fallback for an edit it cannot patch, Metro's own full reload, and DevMenu.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 accessibilityState says disabled: false. On Android, when a view's last committed state said disabled: true and its next one is gone or leaves disabled out, the engine now sends disabled: false with whatever else the state says. This covers a component's disabled, aria-disabled and accessibilityState, 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 of null. A view whose editable or enabled prop is false, or whose disabled prop is true, such as a read-only text field, is not sent it.

  • New apps get Expo 58.1, and @ng-native/expo no longer asks npm for an expo-modules-core of its own, which could put a second copy in an app. (#2060, #2053)

    @ng-native/expo listed expo-modules-core as a required peer, so an install with no lockfile could add a newer copy beside the one expo pins, and an iOS or Android bundle held both. It now uses what expo, already a required peer, exports on SDK 57 and 58. An app that lists expo-modules-core only for @ng-native/expo can remove it; an app that imports it itself keeps it.

    The templates, ng add @ng-native/schematics and @ng-native/nx write expo ~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_SUPPORT now has rows for more native controls and services, and marks the cells that describe a fallback. (#2039)

    fallbackOnly on 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>'s anchor is now marked ignored on iPadOS, and the community masked-view has a row of its own, as macOS and Linux draw it and do not draw slider or picker.

  • The desktop template's README and AGENTS.md give Linux packaging commands with the options they need, and say what app.json needs first. (#2064, #2057)

    --format deb stopped for want of --maintainer. Every Linux package needs expo.description, and a deb, an rpm or a Flatpak needs expo.ios.bundleIdentifier.

  • A macOS or Linux desktop app can ship files inside its package with the @ng-native/desktop plugin's resources option, and run a program among them. (#2047, #2041)

    Each resource is copied into the .app or the Linux package, and a dev run links to it. {os} and {arch} in its from take a build per target. In capabilities.spawn, a program or a literal argument that starts with {resources}/ is a file among them, wherever the app is installed, and Processes.resources is their folder. On macOS package signs each Mach-O file among them before the app, keeping the entitlements it is signed with but get-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.json is invalid. (#2062, #2055)

    @ng-native/metro's desktop runtime named three of Expo's files with a .js that Expo SDK 58's exports adds too. Metro warned about each, then found the file another way, so the bundle itself worked.

  • The @ng-native/nx:sync-native-modules sync 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:library imports @ng-native/testing in 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, export and prebuild could stop in CI, and nx sync added @ng-native/testing to the app's dependencies, 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 .test and .spec files, test-setup files, and a tool's .config file at the library's root, with any JavaScript or TypeScript extension. The generator only adds, so if nx sync added @ng-native/testing to an app's dependencies, remove it there by hand.

❤️ Thank You

  • Ashley Hunter

v0.31.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 10:01

🩹 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, PageUp or PageDown now 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 cxxNativeAnimatedEnabled is 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, and incognito keeps 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 with react-native-webview builds its host from source, and npm run linux warns when that build finds no WebKitGTK. A .deb of a host that links WebKitGTK depends on libwebkitgtk-6.0-4.

    Where WebKitGTK differs from WKWebView: a source's method and body are not sent, loadingStart comes as the page's load starts, and the app is asked about a frame's navigation as about the page's own, with isTopFrame true, since WebKitGTK does not say which frame a navigation is in. originWhitelist applies 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 CSS order of 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 whose order puts 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

Choose a tag to compare

@github-actions github-actions released this 30 Nov 14:28

🚀 Features

  • Prebuilt desktop hosts are now built for React Native 0.88.1 in place of 0.88.0, and @ng-native/template-desktop and desktop-only apps from the generators get 0.88.1, so a desktop app still on react-native 0.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, then npx expo install --fix, which moves react-native to 0.88.1; an app that also runs on iOS then regenerates ios/ with npx expo prebuild -p ios --clean. Until then, ng-native-desktop builds the macOS host from source, and a Linux host only on Linux of the architecture it is for. make-prebuilt.mjs takes --react-native <version> to build a host against a version the app does not have.

  • corner-shape: squircle now gives a rounded corner Apple's continuous curve, on iOS and macOS, and border-curve: continuous now works on macOS as it did on iOS. (#2017, #2016)

    Before, corner-shape was dropped, and the desktop host never read borderCurve, so a view beside the system's own windows and controls had circular corners where theirs are continuous. round is 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 transparent now hides a desktop scroll view's scroll bars and keeps their place, and scrollbar-color: auto draws 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: none gives the bar's strip to the content, so each hover laid the content out again. Hiding the bar with scrollbar-color keeps 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() and scrollToEnd() on a virtual list, and scrollToLocation() 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() and scrollToEnd() 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 a scrollToOffset() or scrollToEnd() 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 maintainVisibleContentPosition when 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 its NgNativeKeyboardFocus module, 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 Menu does. From iOS 17.4 the NgNativeMenus module has openPressMenu(nativeID), and its constants say so with opensPressMenus; 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 with titleBar: '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-compat now 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 tandem is 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 as sources, as Taiga UI's examples are, is hosted by an inline ng-browser-component, laid out as a browser lays out ng-component, where it was a native view. A component with no selector anywhere else keeps its native ng-component host. (#1961)

    A ::before or ::after box 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-compat now 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 ::before with 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 PointerEventsProcessor when a hovered view is freed while its pointer ev...

Read more

v0.29.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 14:28

🩹 Fixes

  • On Android, a scroll-view or virtual-list in a screen presented as a formSheet now scrolls back up on a fresh drag, and a native-header in 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, and consumeTopInset is 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_SHEET from @ng-native/device says whether a screen is in a form sheet. iOS is unchanged.

  • On Android, a text-input or switch already 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 cursorColor or selectionHandleColor set on the field stays, and so does a selectionColor unless it is the old scheme's own selection colour, which then follows the scheme. A switch with thumbColor keeps the ripple React Native gives it, and one with a backgroundColor keeps 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 NgNativeMenus module's new setPressMenu(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 clear UIButton over 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 iOS open() returns false, with one warning in development.

  • Taking the <native-tab> in front out of a <native-tabs-outlet> at runtime, with an @if for 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 @keyframes animation, 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 bitmap drawable, 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) in provideNativeRouter, or the new SVG_ICON_RENDERER token from @ng-native/device in 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 events expo-maps has on one platform only, and a Google marker's icon. (#1877, #1549)

    On iOS, annotations and (annotationClick). On Android, mapOptions, userLocation, contentPadding, (mapLoaded), (mapLongClick) and (poiClick). A marker's or an annotation's icon takes an image as expo-image's useImage returns it and is sent as its shared object's id, as expo-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 fetch body 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() and colorsAt() now work in device tests on macOS: the desktop host has the NgNativeTesting module, 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/desktop on macOS, and that the Linux host does not have it yet, instead of telling you to rebuild a development build. (#1866, #1846)

  • inherit set in an element's own style, style="width: inherit" or [style.width]="'inherit'", is now the parent's value, for the properties a stylesheet takes inherit for, 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 to inherit, initial, unset or revert is dropped with a warning in development, as a stylesheet drops it. font-family keeps the word as it did, and the border shorthand set to inherit is still dropped.

  • <expo-video> and <expo-live-photo> now have the view functions of expo-video's and expo-live-photo's React refs. (#1876, #1548)

    On <expo-video>, enterFullscreen(), exitFullscreen() and startPictureInPicture() work on iOS and Android, and stopPictureInPicture() on iOS, where expo-video has it. Each does nothing on macOS. Picture in picture needs allowsPictureInPicture and the config plugin's supportsPictureInPicture, and on Android a device that supports it. On <expo-live-photo>, startPlayback(style?), full unless set, and stopPlayback() 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, as expo-blur's BlurTargetView and blurTarget do. (#1878, #1550)

    Register the target with registerExpoViews('expo-blur-target'). On Android it is expo-blur's ExpoBlurTargetView, and the blur commits its view tag as blurTargetId, which blurs with a blurMethod other than none. 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...

Read more

v0.28.0

Choose a tag to compare

@github-actions github-actions released this 24 Nov 11:52

🚀 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 query within a 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 fullScreenModal or a containedModal is hidden, and on Android a screen under a modal (what present() shows by default) or a pageSheet too, which Android shows full screen. Everything on a hidden screen is hidden, within included, whether it starts from the screen or from a view on it, and so is what is within a 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 a modal or a pageSheet on 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 !important off, 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.longPress and fireEvent.press on 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 bound isOn, or with none bound, of what the last press switched it to; one SwiftUI's disabled modifier turns off sends none. On Android it ends with Compose's checkedChange, the opposite of the value the switch shows. Either way (isOnChange) runs.

  • userEvent.press, userEvent.longPress and fireEvent.press on 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 change event 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 os it 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 filter such as grayscale(1) is kept, where before it was dropped with the iOS warning, and an iOS project keeps a skewX(), which only Android refuses. A web project'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.clear and fireEvent.press do 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 with includeHiddenElements. A userEvent.press or userEvent.longPress whose screen goes out of sight while the finger is down ends in a cancelled touch, with no press. (#1806, #1783)

    Content of an @expo/ui sheet 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-icons icon, as their icon: [icon]="{ svg: lucideBlocks }". (#1804, #1756)

    ButtonIcon has 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 the svgIcon prop, and on macOS an sfSymbol set beside it wins.

    A <native-tab [icon]="{ svg }"> on macOS and Linux needs no withSvgIcons renderer, and commits its markup as a data:image/svg+xml icon 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 a path that an @for or an @if renders no longer throws NG0950 at launch, and the route selects it as it does a static one. (#1777, #1750, #1755, #1757, #1758)

  • A shortcut on F13 to F20 now 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, F13 to F20 have 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 at F12, 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 with background-size and background-repeat, where it used to be dropped with a build warning. (#1782, #1770, #1774)

    The lowering takes stops in px or rem, 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, em and viewport stops, a first stop not at 0, a corner direction, and a background-size or a background-position in lengths written beside it in the background shorthand are still dropped with a build warning, which now names the tile to write instead. A var() in a repeating gradient, a token holding one, and repeating-radial-gradient are dropped with a warning as before. The tile sets that layer's background size, position and repeat.

    The build error for a component whose styles or host is imported from another file now says what to write instead: a .css file in styleUrl or styleUrls for styles, and bindings in the same file or a directive in hostDirectives for a host.

  • A repeating-linear-gradient(...) along a side with percentage stops now compiles to a tile that percentage of the box, a period in px or rem under 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, 90deg and the like) and only when every positioned stop is a percentage or 0; at any other angle, or mixed with px or rem stops, they are still dropped with a warning. A repeating gradient's background-image written after a background-size, or a background-position in lengths, in the same rule is now dropped with a warning, as it already was beside them in the background shorthand, where its tile used to replace the author's placem...

Read more

v0.27.0

Choose a tag to compare

@github-actions github-actions released this 22 Nov 23:22

🚀 Features

  • Linux is an OS that the packages, the Metro preset and tests know of, ahead of the Linux desktop host. (#1712)

    OS_NAMES, the OS token, TestOs and ModulePlatform gain 'linux', so a switch or Record that covers every OS needs a linux entry. The os-comparisons-on-linux migration 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, DESKTOP is true and APPLE false, the linux: and desktop: Tailwind variants match platform-linux, and <code> and font-mono use monospace. The CSS compiler builds a sheet for linux alone, 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 run npm run linux. Vibration is absent, sharing uses the desktop host's module, windows restore from React Native's Settings as on macOS, Alert.prompt is available, and the Dock and tray menus read mod as Ctrl.

    @ng-native/metro registers linux with Expo SDK 58, which does not know it, for an app whose expo.platforms lists it: a linux bundle resolves .linux, then .ios, then .native files, takes React Native's iOS code, answers Platform.select from linux, then ios, native and default, and installs formatjs's Intl polyfills with English data and every time zone, since the Linux host's Hermes has no Intl. expo export -p linux also needs require('@ng-native/metro/linux.cjs').registerLinux(__dirname) in app.config.js. In @ng-native/eslint-plugin, a desktop event is allowed in a project that lists linux, and its messages say "a desktop OS" rather than macOS.

  • linuxLauncher() now runs the host with a fake system UI by default, which needs dbus-daemon and python3 with PyGObject where the host runs: a launch without them fails with status 70, so install them or pass fakeSystemUi: 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.json in the run's state folder, and it records every call to those portals in portals/calls.jsonl. fakeSystemUi: false runs 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) or scale(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 in scale(2px) or rotate(2px), is now dropped, as Chrome drops it, rather than read as scale(2) or a rotation of 2.

  • A view whose bound opacity, transform or background-color is 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 !important rule or a component's styleOverride sets 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 in em or calc(). 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, Locale and Crypto have a source of their own. AppInfo reads a package's version, build number, id and name from its metadata.json, which now carries the build number as CFBundleVersion, and its device facts from the firmware (the maker as the brand), the distribution's os-release and the kernel. Locale lists the languages LANGUAGE and 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. Crypto digests 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 accessibilityActions reach a screen reader over AT-SPI, listed beside its press as custom.<name> (GTK gives AT-SPI no label for an action), and invoking one sends onAccessibilityAction to 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 plays NGN_INPUT_SCRIPT into its first window under X11 (Xvfb included) through XTest: the pointer steps, key and type. (#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.setColorScheme changed what they answered.

  • On the GTK desktop host on Linux, an alert with more than three buttons, such as Dialogs.choose with 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>, Camera and ImagePicker'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 its IsCameraPresent. 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 and h264parse are 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 sends mountError. facing and mirror do nothing, since the portal offers the cameras as one. ImagePicker.launchCameraAsync shows 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 cc and c++, which is GCC on most distributions, and the build failed on React Native's #pragma mark. CC and CXX, 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=1 also 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, Battery reads 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; Network names Wi-Fi, Ethernet or cellular from NetworkManager's primary connection, and OTHER without NetworkManager; and Location takes 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:...

Read more

v0.26.1

Choose a tag to compare

@ashley-hunter ashley-hunter released this 22 Nov 22:37
0f28e0f

This was a version bump only, there were no code changes.

v0.26.0

Choose a tag to compare

@github-actions github-actions released this 22 Nov 20:58

🚀 Features

  • vitest --project ios and vitest --project android start Metro, build the app's development build, boot the simulator or emulator and launch the app themselves, as --project macos starts 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-tests by 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 on RCT_METRO_PORT or 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 ios or android folder is prebuilt for the build, with its app.json, app.config.* and package.json put 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-desktop command 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 a velocityLead input 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 velocityLead milliseconds (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 a scrollToIndex, scrollToOffset or scrollToEnd call 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. velocityLead of 0 keeps the previous window.

  • Where native moves sticky rows, a jump with scrollToIndex past 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], as FlatList's numColumns does, 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 or screen (the whole window) on an iOS simulator or an Android emulator (Android 8 or later), and compares it with __screenshots__/<test file>/<name>-<platform>.png beside the test. A missing reference is recorded, except on CI; -u records 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, unless comparatorOptions (channelTolerance, where 0 is exact, threshold, allowedMismatchedPixels, allowedMismatchedPixelRatio) say otherwise, in deviceTests({ 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/platform is 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/fabric no longer keeps the first engine that joined it once that engine has left.

  • releaseOnDestroy in @ng-native/components and @ng-native/components/reanimated wraps a function a worklet calls back, such as a scheduleOnRN target, 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 releaseOnDestroy returns calls the one it was given until the component, or the DestroyRef passed to it, is destroyed, and then does nothing.

    The stand-in document that mount in @ng-native/platform gives Angular no longer keeps the last app reachable after it is destroyed, so a component that a render() in @ng-native/testing has unmounted can be garbage-collected, with its engine and fake Fabric.

  • @ng-native/device exports OS_NAMES, the OSes Angular Native runs on, and OsName, the type of one of them. The OS token, ShortcutOs, TestOs in @ng-native/testing and ModulePlatform in @ng-native/expo are that type, so the next OS is added in one place. (#1556)

    An OS the host reports that is not in OS_NAMES is now an error that names it, where OS and the keyboard shortcuts used to read it as iOS. In a test, an NG_NATIVE_TEST_OS or a Vitest preset os outside 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:tailwind can now wrap an app's Metro config in withTailwind when its one module.exports spans more than one line, as a newly generated app's does once it is formatted. Before, it warned it could not update metro.config.js and still added the app.tailwind.js import to src/main.ts, so the app's typecheck and bundle failed on a sheet nothing built. Where it cannot wrap the config, it now leaves src/main.ts as it is too, and its warning names both steps to take by hand. A config that exports a const already wrapped in withTailwind is left as it is, and one with a withTailwind of 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...

Read more

v0.25.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 16:28

🩹 Fixes

  • @ng-native/platform and @ng-native/web work with Angular 22.3, which removed the internal ɵsetLocaleId they 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 read LOCALE_ID from the app's injector, so an app's LOCALE_ID still 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 by ColorScheme.set on 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 uiMode itself, as Expo's does, keeps its views across the change, so the off track could vanish against the new background. The NgNativeColorScheme module now tints each AppCompat switch in the activity again after each configuration change it takes in place. A thumbColor or trackColor set 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's addEventListener, removeEventListener and dispatchEvent away, so a service that listened with fromEvent(window, 'resize') and toSignal or takeUntilDestroyed, as Taiga UI's root does, failed to take its listener off, and rxjs threw an UnsubscriptionError from ApplicationRef.destroy() and @ng-native/testing's cleanup(). (#1421)

    Those three now stay on the window once the last app has gone, where withWebCompat gave 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 the style attribute, such as [style], [style*=top] or :not([style*=top]), now matches the style attribute's text as a script writes it through element.style (a property by name, setProperty, removeProperty or cssText) or with setAttribute, 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 style attribute, which cssText = '' or removing a script's last property leaves, still matches [style], and removeAttribute('style') stops it matching where a template sets no style on the element, as in Chrome. A copy made with cloneNode matches by the attribute it was copied with. Once a script takes away every declaration it wrote, the view's style prop is removed rather than left as an empty object. A style a template sets, in a style attribute or with a binding, is still not part of the attribute's text.

  • @ng-native/web-compat has provideEventPlugins(), 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 for tui-tab-activate.stop through @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-browser is 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's Meta adds, finds, updates and removes its <meta> tags in the document's head, and document.title reads and writes the first <title>, which Angular's Title sets. (#1422)

    getDOM() was null under Angular Native, so Meta.addTag(), updateTag() for a tag not yet there and removeTag() threw, as did code that calls them, such as Taiga UI's provideTaiga() for its font scaling, and Title.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 global document, 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's getElementsByTagName, getElementsByTagNameNS, getElementsByClassName, getElementsByName and getElementById now find <html> and <head>, as Chrome does, so document.getElementsByTagName('head')[0] is document.head and getElementsByClassName('dark') finds a theme class on <html>. (#1420)

    They answered no <html> and no <head> before, which made code such as Taiga UI's provideTaiga() and Angular's Meta throw when it read getElementsByTagName('head')[0]. The elements come in the order querySelectorAll gives them, so getElementsByTagName('*') and querySelectorAll('*') 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 own getElementsBy* 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 a windowSize input that caps how far. (#1639, #1627)

    The window used to be the visible rows plus overscan rows 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 to windowSize viewports in all (5 by default; FlatList defaults 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, scrollToOffset and scrollToEnd to 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. windowSize of 1 keeps the old window.

  • withAngularNative takes an experimental compilation: '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's compilation: 'ngp' does. (#1570)

    It needs Angular 22.2 or later. @ng-native/metro ships a build of @angular/ngp until 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: true turns it off, and tsconfig names 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 as label="File") with no menuRole, which is drawn as a second menu of that name, now logs a warning saying so, and that menuRole="file" adds its items to the File menu instead. (#1613)

  • SegmentedControl and DateTimePicker from @ng-native/expo register their element the first time one is made, so an app that imports one no longer needs a registerNativeViews('segmented-control') or registerNativeViews('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 (and textDecorationLine: 'line-through' or 'underline line-through') now draws a line through the text, which it never did, and an underline or a line through takes text-decoration-color and a double, dotted or dashed text-decoration-style. (#1611)

  • On macOS align-items: baseline (and alignItems: '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...

Read more

v0.24.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 17:25

🩹 Fixes

  • Camera from @ng-native/expo/camera gains a mute input that sets <expo-camera>'s mute prop, 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 mute attribute is true, and null or undefined leaves the prop unset, with sound. Before, a bare mute committed an empty string, which no platform reads as true, and [mute] did not compile. On macOS the view's mute as record() 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 a mute option of its own on macOS, which was never part of expo-camera's CameraRecordingOptions.

  • ColorScheme.set on Android 12 and later, in an app rebuilt with this release of @ng-native/components, also sets the app's night mode through UiModeManager.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.setColorScheme sets only AppCompat's default night mode, which the system overwrote on activities that handle uiMode themselves, as Expo's do, while the CSS kept the chosen scheme. The new NgNativeColorScheme module ships in @ng-native/components and needs a native rebuild; Expo Go keeps the old behaviour. On Android 12 and later the system now keeps the scheme across launches until set() or set(null) changes it; iOS and earlier Android are unchanged.

  • @ng-native/expo gains typed components for <expo-video>, <expo-blur>, <expo-gl>, <expo-mesh-gradient> and <expo-live-photo>, Camera takes all of <expo-camera>'s view props as inputs, and MapView also 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, ExpoMeshGradient and ExpoLivePhoto are on the bare @ng-native/expo import. Each input is the module's own view prop, typed, and goes to the view as it is, except that ExpoVideo's player takes a videoPlayer() as well as its id and commits the id. A boolean input written bare is true, null or undefined leaves 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's msaaSamples is 4 unless set on iOS, as expo-gl's GLView sends 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 are facing, flash, zoom, mode, mirror, autofocus, active, videoQuality, videoBitrate, animateShutter, pictureSize, selectedLens, enableTorch, videoStabilizationMode, barcodeScannerEnabled, barcodeScannerSettings, responsiveOrientationWhenOrientationLocked and ratio. flash and autofocus are now committed as flashMode and autoFocus, the props the native view reads, as expo-camera's CameraView renames them; before, flash="on" and autofocus="on" on the element reached no native prop. flashMode and autoFocus still work, as inputs, and flash or autofocus wins when both are set. flash is committed as off unless set, as CameraView sends it, so an iOS camera with Camera imported no longer fires the flash automatically by default; set flash="auto" for that.

    MapView's shape colours also take a number, a colour React Native's processColor already returned, as expo-maps' own types do, and pass it to native unconverted. A template that imports Camera and 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 no textAlign in 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 ignore textAlign and writingDirection. With no textAlign its text and placeholder now align to the right when I18nManager.isRTL is true and to the left otherwise. A textAlign that is set on a <text-input> applies as React Native iOS applies it, not turned round in right to left: auto, start and left align to the left, end and right to the right, and center and justify as named. That differs from <text>, where right to left puts auto and start on the right and end on the left and swaps left and right, as on iOS. writingDirection sets the field's base writing direction.

  • On macOS, an app's views now lay out right to left whenever I18nManager.isRTL is true (a right-to-left system language, unless the app calls allowRTL(false), or forceRTL(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-leading measures 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, auto or start aligns to the right whatever its script, end aligns to the left, and left and right swap, where text used to align by its own script and keep left and right as they are. In a left-to-right layout an alignment of auto or start that is set aligns to the left, as on iOS. A text input's text and placeholder are unchanged. When I18nManager.isRTL is 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 own y, starts a chunk, anchored by its own text-anchor; on a <textPath> a span's y places 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, from startOffset (a length or a percentage of the path), with side="right" setting it along the path reversed; a glyph whose middle falls off the path is not drawn. A <tspan>'s or <textPath>'s opacity now applies once to all the text it holds. A character's x, y, dx and dy come from the innermost element that sets them for it, as in Chrome, so a <text>'s dx and dy reach the first glyph on its <textPath> and a <tspan> with no characters places nothing. method and spacing are not read, and <foreignObject> content still does not draw.

  • On macOS an svg draws the views in a foreignObject at its x and y, cut to its width and height, 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 the www.bundle that ng-native-desktop package writes into the app's Resources in a packaged app. (#1528, #1509)

  • On macOS ImagePicker.capture() from @ng-native/expo takes a photo with the d...

Read more