Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
38ceb44
feat: flavor snippets wip
NathanWalker Aug 3, 2024
fc797f3
Merge remote-tracking branch 'origin/main' into feat/flavor-snippets
NathanWalker Aug 12, 2024
85b3339
chore: cleanup template
NathanWalker Aug 12, 2024
c55cea3
chore: add shared assets
NathanWalker Aug 12, 2024
41a6cbc
chore: cleanup dialogs
NathanWalker Aug 12, 2024
b29a122
feat: angular flavor wip
NathanWalker Aug 12, 2024
cc8ed1c
Merge remote-tracking branch 'origin/main' into feat/flavor-snippets
NathanWalker Aug 13, 2024
08c0128
feat: angular flavor
Aug 13, 2024
affa653
feat: vue 3 flavor wip
NathanWalker Aug 13, 2024
a46a310
Updates: Vue Flavor
mbflores Aug 14, 2024
36dafb7
Flavors Vue Update
mbflores Aug 14, 2024
f10e27b
feat: angular flavor - ActionBar and TabView fixes
Aug 14, 2024
26a7243
Updates: Vue Flavor
mbflores Aug 14, 2024
2efa8ac
Flavor: Vue
mbflores Aug 14, 2024
488fd86
Flavor: Vue
mbflores Aug 15, 2024
7c3d4c1
Fix Webview
mbflores Aug 16, 2024
b28aeb5
Flavor: Svelte
mbflores Aug 19, 2024
a743e33
Flavors: Svelte Update
mbflores Aug 19, 2024
8fbd177
Flavor Update: Svelte
mbflores Aug 19, 2024
8c13286
Flavor Update: Svelte
mbflores Aug 19, 2024
8d70ec0
Finalized Svelte Flavor
mbflores Aug 19, 2024
ef238cd
Flavor: SolidJS
mbflores Aug 20, 2024
1b0cd6e
WIP Solid
mbflores Aug 28, 2024
71b4d90
Flavor Update: Solid
mbflores Aug 28, 2024
446a73d
Flavor Update: SolidJS
mbflores Aug 29, 2024
2b42f00
Flavor Update: SolidJS
mbflores Aug 29, 2024
5a17662
Flavor Update: SolidJS
mbflores Aug 29, 2024
326f5f1
Flavor Update: React
mbflores Aug 30, 2024
23a9a61
Flavor Update: React
mbflores Sep 2, 2024
bec6dcd
Merge remote-tracking branch 'origin/main' into feat/flavor-snippets
NathanWalker Sep 28, 2024
4e046cd
feat: add snippets to ui guide component pages
NathanWalker Sep 28, 2024
dccddf6
Merge remote-tracking branch 'origin/main' into feat/flavor-snippets
NathanWalker Feb 7, 2025
e32d3fc
feat: updated angular sample to 19.1
NathanWalker Feb 7, 2025
52fc603
feat: add tsx region support for snippets
rigor789 Feb 7, 2025
211e3ca
fix: clean up snippets
rigor789 Feb 7, 2025
d3514fe
feat: new tabs
rigor789 Feb 22, 2025
b4b6da7
feat: 8.9 additions
NathanWalker Feb 22, 2025
e5ae274
chore: format
NathanWalker Feb 22, 2025
3bacbba
feat(config): ios.NativeSource option (#161)
NathanWalker Feb 22, 2025
0323f9a
feat: ns widget ios
NathanWalker Feb 22, 2025
ea8a8ad
format
NathanWalker Feb 22, 2025
6970711
ci: build
NathanWalker Feb 22, 2025
72215c9
Merge remote-tracking branch 'origin/main' into feat/flavor-snippets
NathanWalker Feb 23, 2025
e7775b6
Merge branch 'main' into feat/flavor-snippets
NathanWalker Feb 23, 2025
d0f67b4
Merge branch 'main' into feat/8.9-core-additions
NathanWalker Feb 23, 2025
a7bc70b
chore: bump vitepress
NathanWalker Feb 23, 2025
5aa0d48
fix: build
NathanWalker Feb 23, 2025
f10c794
chore: format
NathanWalker Feb 23, 2025
ed3a1bc
Merge branch 'feat/8.9-core-additions' into feat/flavor-snippets
NathanWalker Feb 23, 2025
91cf7fa
feat: flavor snippets (#151)
NathanWalker Feb 23, 2025
2c6979d
chore: widget docs
NathanWalker Feb 23, 2025
40d224a
chore: docs tabs
NathanWalker Feb 24, 2025
6ad47ea
feat: flavor tabs
NathanWalker Feb 24, 2025
2655c0d
ci: format
NathanWalker Feb 24, 2025
ca69255
ci: cleanup
NathanWalker Feb 24, 2025
0f4e76b
chore: update cli to bash for syntax highlighting
NathanWalker Feb 24, 2025
2951e82
feat: widget video
NathanWalker Feb 24, 2025
b819d01
feat: solid vibes snack
NathanWalker Feb 25, 2025
6a0fc46
chore: updates
NathanWalker Feb 25, 2025
873a333
Merge branch 'main' into feat/8.9-core-additions
NathanWalker Feb 27, 2025
8b1b1a0
chore: yarn
NathanWalker Feb 27, 2025
75b6bcd
chore: asset path
NathanWalker Feb 27, 2025
720bf62
ci: build
NathanWalker Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19
node-version: 22.14.0
cache: 'npm'
- run: npm ci
- run: yarn
- run: npm run lint --if-present
- run: npm run build --if-present
env:
Expand Down
8 changes: 8 additions & 0 deletions .vitepress/clientAppEnhance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default ({ router }) => {
router.afterEach(() => {
// Ensure the DOM is updated before scrolling
setTimeout(() => {
window.scrollTo(0, 0)
}, 0)
})
}
4 changes: 3 additions & 1 deletion .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import mainSidebar from '../content/sidebar'
import uiSidebar from '../content/ui/sidebar'
import pluginsSidebar from '../content/plugins/sidebar'
import nav from './nav'
import './theme/cliLanguage'
import './clientAppEnhance';
// import './theme/cliLanguage'
import path from 'node:path'
import { SiteMap } from './genSitemap.mjs'

Expand Down Expand Up @@ -71,6 +72,7 @@ export default defineConfig({
},
markdown: {
headers: true,
theme: "github-dark"
},
async transformPageData(pageData, { siteConfig }) {
// const contributors = await githubAuthors.getAuthorsForFilePath(
Expand Down
14 changes: 7 additions & 7 deletions .vitepress/theme/cliLanguage.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// https://mysticmind.dev/vitepress-fenced-code-block-syntax-highlighting-quirks-with-net-or-other-languages
import { BUNDLED_LANGUAGES } from "shiki";
import cliLanguageGrammar from "./shiki/cli.tmLanguage.json";
import { bundledLanguages } from 'shiki'
import cliLanguageGrammar from './shiki/cli.tmLanguage.json'

BUNDLED_LANGUAGES.push({
id: "cli",
scopeName: "source.cli",
// @ts-ignore
bundledLanguages['cli'] = {
id: 'cli',
scopeName: 'source.cli',
grammar: cliLanguageGrammar,
});
}
// bundledLanguages.push()
Binary file added content/assets/publishing/launch-android-002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/assets/publishing/launch-android-003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/assets/publishing/launch-android-004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/assets/publishing/launch-android-005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions content/best-practices/ios-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let applePayController: PKPaymentAuthorizationViewController

applePayController =
PKPaymentAuthorizationViewController.alloc().initWithPaymentRequest(
paymentRequest
paymentRequest,
)
applePayController.delegate =
PKPaymentAuthorizationViewControllerDelegateImpl.initWithOwner(this)
Expand All @@ -32,7 +32,7 @@ let applePayControllerDelegate: PKPaymentAuthorizationViewControllerDelegateImpl

applePayController =
PKPaymentAuthorizationViewController.alloc().initWithPaymentRequest(
paymentRequest
paymentRequest,
)
applePayControllerDelegate =
PKPaymentAuthorizationViewControllerDelegateImpl.initWithOwner(this)
Expand Down
4 changes: 2 additions & 2 deletions content/best-practices/native-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You can use setup methods in this case to mitigate any cross compilation issue,
```ts
let customClass
function setupCustomClass() {
if (global.isAndroid) {
if (__ANDROID__) {
@NativeClass()
class CustomClass extends android.view.View {}
customClass = CustomClass
Expand All @@ -44,7 +44,7 @@ setupCustomClass()
const customClassInstance = new customClass() // can handle different platform args with ternary if needed
```

The `global.isAndroid` conditional will get removed when building the app for iOS so your compiled code is clean and isolated while allowing you to handle in a single file.
The `__ANDROID__` macro will get removed when building the app for iOS so your compiled code is clean and isolated while allowing you to handle in a single file.

## When exported from a file and used elsewhere

Expand Down
2 changes: 1 addition & 1 deletion content/best-practices/platform-file-split-or-not.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The advent of tree shaking and webpack builds does away with quite a bit of worr

## Conditional with tree shaking

When speaking of tree shaking ever since NativeScript 7, you've been able to use `global.isAndroid` or `global.isIOS` and anytime those are used as conditional splits in your code, only the applicable code for the platform that's being built would actually end up in your compiled code alleviating a lot of concern here.
When speaking of tree shaking ever since NativeScript 7, you've been able to use `__ANDROID__` or `global.isIOS` and anytime those are used as conditional splits in your code, only the applicable code for the platform that's being built would actually end up in your compiled code alleviating a lot of concern here.

## Future maintenance

Expand Down
62 changes: 62 additions & 0 deletions content/configuration/nativescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ ios.SPMPackages: Array<{
libs: Array<string>;
repositoryURL: string;
version: string;
/**
* (8.9+) If you have more targets (like widgets for example),
* you can list their names here to include the Swift Package with them.
*/
targets?: string[];
}>
```

Expand All @@ -392,6 +397,63 @@ ios: {
}
```

### ios.NativeSource

::: tip

NativeSource config option is available in `[email protected]` or newer.

:::

```ts
ios.NativeSource: Array<{
name: string;
path: string;
}>
```

Include any native source code from anywhere in the project (or workspace). Glob patterns are fully supported.

#### Example

- Include any `.swift` files anywhere within the project `src` directory:

```ts
// ...
ios: {
NativeSource: [
{
name: 'ProjectPlatformSrc',
path: './src/**/*.swift'
}
],
}
```

This will create a file reference folder named `ProjectPlatformSrc` within the generated Xcode project containing any .swift files found anywhere within the project `src` directory.

- Include any `.swift` files anywhere within the project `src` directory, including any (Swift, Obj-C impl/headers, as well as any module.modulemap files) within a workspace `packages` or `libs` dir:

```ts
// ...
ios: {
NativeSource: [
{
name: 'ProjectPlatformSrc',
path: './src/**/*.swift'
},
{
name: 'Auth',
path: '../../packages/**/*.{swift,m,h,modulemap}'
},
{
name: 'Purchasing',
path: '../../libs/**/*.{swift,m,h,modulemap}'
}
],
}
```

## Hooks Configuration Reference

```ts
Expand Down
12 changes: 6 additions & 6 deletions content/configuration/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Add file replacement rules. For source files (`.js` and `.ts`) this will add a n

Example:

```cli
```bash
--env.replace=./src/environments/environment.ts:./src/environments/environment.prod.ts
```

Expand Down Expand Up @@ -324,7 +324,7 @@ module.exports = (env) => {
config.get('externals').concat([
// add your own externals
'some-external-dependency',
])
]),
)
})

Expand Down Expand Up @@ -380,7 +380,7 @@ module.exports = (env) => {

To change an existing rule, it's useful to know how it has been set up first:

```cli
```bash
ns prepare android|ios --env.verbose
# Note: we plan to add a separate command to just print the internal config
```
Expand Down Expand Up @@ -518,7 +518,7 @@ module.exports = (env) => {
'ignoreWarnings',
(config.get('ignoreWarnings') || []).concat([
/a regex that matches the warning to suppress/,
])
]),
)
})

Expand Down Expand Up @@ -577,7 +577,7 @@ module.exports = (webpack) => {
.test(/\.something$/)
.use('something-loader')
.loader('something-loader')
} /*, options */
} /*, options */,
)
}
```
Expand Down Expand Up @@ -641,7 +641,7 @@ webpack.chainWebpack(
(config, env) => {
config.set('somethingThatShouldBeSetLast', true)
},
{ order: 10 }
{ order: 10 },
)
```

Expand Down
10 changes: 5 additions & 5 deletions content/core/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (isAndroid) {
const androidApp: AndroidApplication = Application.android

androidApp.unregisterBroadcastReceiver(
android.content.Intent.ACTION_BATTERY_CHANGED
android.content.Intent.ACTION_BATTERY_CHANGED,
)
}
```
Expand Down Expand Up @@ -76,7 +76,7 @@ To add an iOS notification observer, follow the steps below:
UIDeviceOrientationDidChangeNotification,
(notification: NSNotification) => {
//Handle the notification
}
},
)
```

Expand All @@ -89,7 +89,7 @@ To remove a notification observer, use the `removeNotificationObserver` method o
```ts
iOSApp.removeNotificationObserver(
observer,
UIDeviceBatteryStateDidChangeNotification
UIDeviceBatteryStateDidChangeNotification,
)
```

Expand Down Expand Up @@ -350,7 +350,7 @@ const MyDelegate = (function (_super) {
}
MyDelegate.prototype.applicationDidFinishLaunchingWithOptions = function (
application,
launchOptions
launchOptions,
) {
console.log('applicationWillFinishLaunchingWithOptions: ' + launchOptions)
return true
Expand All @@ -372,7 +372,7 @@ class MyDelegate extends UIResponder implements UIApplicationDelegate {

applicationDidFinishLaunchingWithOptions(
application: UIApplication,
launchOptions: NSDictionary<string, any>
launchOptions: NSDictionary<string, any>,
): boolean {
console.log('applicationWillFinishLaunchingWithOptions: ' + launchOptions)

Expand Down
12 changes: 6 additions & 6 deletions content/core/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Http.getString('https://httpbin.org/get').then(
(result: string) => {
// do something with the string response
},
(e) => {}
(e) => {},
)
```

Expand All @@ -30,7 +30,7 @@ Http.getJSON('https://httpbin.org/get').then(
(result) => {
console.log(result)
},
(e) => {}
(e) => {},
)
```

Expand All @@ -40,12 +40,12 @@ Use the [getFile()](#getfile) method for a GET request with a response as a [Fil

```ts
Http.getFile(
'https://art.nativescript.org/logo/export/NativeScript_Logo_Wide_White_Blue_Rounded_Blue.png'
'https://art.nativescript.org/logo/export/NativeScript_Logo_Wide_White_Blue_Rounded_Blue.png',
).then(
(resultFile: File) => {
// The returned result will be File object
},
(e) => {}
(e) => {},
)
```

Expand All @@ -56,7 +56,7 @@ Use the [getImage()](#getimage) method for a GET request with a response as an i
```ts
Http.getImage('https://httpbin.org/image/jpeg').then(
(res: ImageSource) => {},
(e) => {}
(e) => {},
)
```

Expand All @@ -83,7 +83,7 @@ Http.request({
},
(e) => {
// error
}
},
)
```

Expand Down
4 changes: 2 additions & 2 deletions content/core/image-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const color = new Color('black')
const imageSource: ImageSource = ImageSource.fromFontIconCodeSync(
'\uf004',
font,
color
color,
)
```

Expand Down Expand Up @@ -206,7 +206,7 @@ Create an ImageSource from the specified local file or resource (if specified wi
const imageSource: ImageSource = ImageSource.fromFontIconCodeSync(
source,
font,
color
color,
)
```

Expand Down
4 changes: 2 additions & 2 deletions content/core/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To verify if a path is valid resource or local file path, use the [isFileOrResou

```ts
const isPathValid: boolean = Utils.isFileOrResourcePath(
'https://nativescript.org/'
'https://nativescript.org/',
) // false

// or
Expand Down Expand Up @@ -612,7 +612,7 @@ Gets the string id from a given resource name.
```ts
const paletteColor: number = Utils.android.resources.getPaletteColor(
resourceName,
Utils.android.getApplicationContext()
Utils.android.getApplicationContext(),
)
```

Expand Down
Loading