refactor: improved core barrel exports and Application class#10286
Merged
NathanWalker merged 25 commits intobetafrom May 17, 2023
Merged
refactor: improved core barrel exports and Application class#10286NathanWalker merged 25 commits intobetafrom
NathanWalker merged 25 commits intobetafrom
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 6d6d6df. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
…, Connectivity, Http wip
NathanWalker
pushed a commit
that referenced
this pull request
May 25, 2023
BREAKING CHANGES:
`Application.orientation` is no longer a function.
Migration: Remove `()` from the `Application.orientation()` call:
```diff
import { Application } from "@nativescript/core";
-console.log(Application.orientation());
+console.log(Application.orientation);
```
`Application.systemAppearance` is no longer a function.
Migration: Remove `()` from the `Application.systemAppearance()` call:
```diff
import { Application } from "@nativescript/core";
-console.log(Application.systemAppearance());
+console.log(Application.systemAppearance);
```
5 tasks
5 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
Current type docs issues
Note how there's missing type info on the various members.
What is the new behavior?
Application module is now a class. The ios/android Application classes have been combined with the Application class as subclasses. Cleaned up and simplified
Applicationflows, reduced code duplication between platforms and extracted to the ApplicationCommon class. Improved typings.The changes cleaned up root barrel exports that were using a
const x = {}map to instead export whole modules as a namespace. For example:Utils. This ensures our type docs can be generated properly, as well as reduces the chance of missing a re-export in the main barrel (as it was the case with a few utils, unnoticed).To make the changes backwards compatible, there's a new
application-shims.tsfile that maps the old Application module exports to theApplicationinstance. These are correctly marked as deprecated to let users know to migrate away from the deep imports at their convenience.New type docs example
The Utils are now documented as a proper namespace and every exported member has a corresponding linkable entry.
BREAKING CHANGES:
Application.orientationis no longer a function.Migration: Remove
()from theApplication.orientation()call:import { Application } from "@nativescript/core"; -console.log(Application.orientation()); +console.log(Application.orientation);Application.systemAppearanceis no longer a function.Migration: Remove
()from theApplication.systemAppearance()call:import { Application } from "@nativescript/core"; -console.log(Application.systemAppearance()); +console.log(Application.systemAppearance);