Skip to content

Commit a94bddb

Browse files
committed
Merge branch 'main' into docs/ui
2 parents 8fbbee8 + 468d133 commit a94bddb

24 files changed

+9768
-866
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Docs CI
22

33
on:
44
push:
5-
branches: [ main, docs/ui ]
5+
branches: [main, docs/ui]
66
pull_request:
7-
branches: [ main, docs/ui ]
7+
branches: [main, docs/ui]
88
merge_group:
9+
branches: [main, docs/ui]
910

1011
jobs:
1112
build:
12-
1313
runs-on: ubuntu-latest
1414

1515
steps:
@@ -20,7 +20,14 @@ jobs:
2020
node-version: 19
2121
cache: 'npm'
2222
- run: npm ci
23-
- run: npm run lint:check --if-present
23+
- run: npm run lint --if-present
2424
- run: npm run build --if-present
2525
env:
26-
NODE_OPTIONS: "--max_old_space_size=4096"
26+
NODE_OPTIONS: '--max_old_space_size=4096'
27+
# disabled because the output of textlint marks warnings as errors
28+
# # re-run lint:text with junit output for github annotations
29+
# - run: npm run lint:text -- --format junit --output-file lint-report.xml
30+
# - uses: mikepenz/action-junit-report@v3
31+
# if: always()
32+
# with:
33+
# report_paths: 'lint-report.xml'

.textlintrc

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"rules": {
3+
"terminology": {
4+
"severity": "warning",
5+
"defaultTerms": false,
6+
// Some terms borrowed from https://github.com/cypress-io/cypress-documentation/blob/main/.textlintrc
7+
"terms": [
8+
// NativeScript specifics
9+
["absolute[- ]?layout(s?)", "AbsoluteLayout$1"],
10+
["dock[- ]?layout(s?)", "DockLayout$1"],
11+
["flex(box)?[- ]?layout(s?)", "FlexboxLayout$1"],
12+
["grid[- ]?layout(s?)", "GridLayout$1"],
13+
["root[- ]?layout(s?)", "RootLayout$1"],
14+
["stack[- ]?layout(s?)", "StackLayout$1"],
15+
["wrap[- ]?layout(s?)", "WrapLayout$1"],
16+
["activity[- ]?indicator(s?)", "ActivityIndicator$1"],
17+
["date[- ]?picker(s?)", "DatePicker$1"],
18+
["html[- ]?view(s?)", "HtmlView$1"],
19+
["list[- ]?picker(s?)", "ListPicker$1"],
20+
["list[- ]?view(s?)", "ListView$1"],
21+
["place[- ]?holder(s?)", "Placeholder$1"],
22+
["scroll[- ]?view(s?)", "ScrollView$1"],
23+
["search[- ]?bar(s?)", "SearchBar$1"],
24+
["segmented[- ]?bar(s?)", "SegmentedBar$1"],
25+
["tab[- ]?view(s?)", "TabView$1"],
26+
["text[- ]?field(s?)", "TextField$1"],
27+
["text[- ]?view(s?)", "TextView$1"],
28+
["time[- ]?picker(s?)", "TimePicker$1"],
29+
["web[- ]?view(s?)", "WebView$1"],
30+
["action[- ]?bar(s?)", "ActionBar$1"],
31+
32+
// Brands and Technologies
33+
"JavaScript",
34+
"TypeScript",
35+
"NativeScript",
36+
["ns", "NativeScript"],
37+
"GitHub",
38+
["VSCode", "VS Code"],
39+
"webpack",
40+
["WebSocket(s?)", "WebSocket$1"],
41+
"WiFi",
42+
"API",
43+
["API['’]?s", "APIs"],
44+
"CLI",
45+
"CSS",
46+
47+
// Words and phrases
48+
["\\(s\\)he", "they"],
49+
["he or she", "they"],
50+
["he/she", "they"],
51+
["crazy", "complex"],
52+
["crazier", "more complex"],
53+
["craziest", "most complex"],
54+
["dumb", "unintended"],
55+
["insane", "outrageous"],
56+
["blacklist", "block"],
57+
["whitelist", "allow"],
58+
59+
// Prefer American spelling
60+
["behaviour", "behavior"],
61+
["cancelled", "canceled"],
62+
["cancelling", "canceling"],
63+
["centre", "center"],
64+
["colour", "color"],
65+
["customise", "customize"],
66+
["customisation", "customization"],
67+
["favourite", "favorite"],
68+
["labelled", "labeled"],
69+
["licence", "license"],
70+
["organise", "organize"],
71+
72+
// Common misspellings
73+
["gaurantee", "guarantee"],
74+
75+
// Words we would like to not use altogether
76+
["obviously", ""],
77+
["basically", ""],
78+
["simply", ""],
79+
["of( )?course", ""],
80+
["clearly", ""],
81+
["just", ""],
82+
["everyone knows", ""],
83+
["easy", ""],
84+
85+
// Words we would like to not use at the start of a sentence
86+
["^so", ""],
87+
["^and", ""],
88+
["^but", ""],
89+
["^however", ""],
90+
91+
// Single word
92+
["change[- ]log(s?)", "changelog$1"],
93+
["code[- ]base(es?)", "codebase$1"],
94+
["e[- ]mail(s?)", "email$1"],
95+
["end[- ]point(s?)", "endpoint$1"],
96+
["file[- ]name(s?)", "filename$1"],
97+
["can[- ]not", "cannot$1"],
98+
["back-?end(s?)", "backend$1"],
99+
["front-?end(s?)", "frontend$1"],
100+
["full-?stack(s?)", "fullstack$1"],
101+
102+
// Multiple words
103+
["open-?source(ed?)", "open source$1"],
104+
105+
// Hyphenated
106+
["end ?to ?end", "end-to-end"],
107+
["retryability", "retry-ability"],
108+
["retriability", "retry-ability"],
109+
110+
// Shortened words
111+
["repo\\b", "repository"],
112+
["repos\\b", "repositories"]
113+
]
114+
}
115+
},
116+
"filters": {
117+
"comments": true
118+
}
119+
}

content/configuration/nativescript.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ contributors:
99
The `nativescript.config.ts` is a central place to configure your project. It allows you to configure your project structure, application id, runtime related flags and more.
1010

1111
::: info Note about the `.ts` extension
12-
You can author the config file as plain `.js` file as well, however we recommend sticking with the `.ts` extension even if your project doesn't use TypeScript, because most editors will provide autocompletion in the `.ts` file.
12+
You can author the config file as plain `.js` file as well. We recommend sticking with the `.ts` extension even if your project doesn't use TypeScript, because most editors will provide autocompletion in the `.ts` file.
1313
:::
1414

1515
By default a config looks somewhat like the following
@@ -98,7 +98,7 @@ TODO: document or remove?
9898
webpackConfigPath: string = 'custom-webpack.config.js'
9999
```
100100

101-
Specifies the [webpack config](/webpack) location. The default is `webpack.config.js` in the root however you can use a custom name and place elsewhere.
101+
Specifies the [webpack config](/webpack) location. The default is `webpack.config.js` in the root.
102102

103103
### profiling
104104

@@ -126,8 +126,12 @@ ignoredNativeDependencies: string[] = ['@nativescript/imagepicker']
126126

127127
A list of npm package names to ignore when attaching native dependencies to the build.
128128

129+
<!-- textlint-disable -->
130+
129131
### cli
130132

133+
<!-- textlint-enable -->
134+
131135
```ts
132136
cli: Object = {}
133137
```
@@ -172,7 +176,7 @@ cli.packageManager: 'npm' | 'yarn' | 'pnpm' | 'yarn2' = 'yarn';
172176

173177
Sets the package manager to use for this project.
174178

175-
Defaults to the package manager set with the cli (`ns package-manager set yarn`), or `npm` if not set.
179+
Defaults to the package manager set with the CLI (`ns package-manager set yarn`), or `npm` if not set.
176180

177181
### cli.pathsToClean
178182

@@ -208,7 +212,7 @@ See also [ios.id](#ios-id).
208212
android.discardUncaughtJsExceptions: boolean = true;
209213
```
210214

211-
Discard any uncaught JS exceptions. This can be very useful in production environments where you don't want your app to crash in case an unexpected JS exception is thrown.
215+
Discard any uncaught JS exceptions. This can be useful in production environments where you don't want your app to crash in case an unexpected JS exception is thrown.
212216

213217
### android.v8Flags
214218

@@ -256,7 +260,13 @@ Trigger a gc periodically (in `ms`). Defaults to `0` (disabled).
256260
android.markingMode: 'none' | 'full';
257261
```
258262

259-
Sets the default gc marking mode, defaults to `none`. `full` has been deprecated and it's not recommended.
263+
Sets the default gc marking mode, defaults to `none`.
264+
265+
::: warning Deprecated value
266+
267+
`full` has been deprecated and it's not recommended.
268+
269+
:::
260270

261271
### android.handleTimeZoneChanges
262272

@@ -272,7 +282,7 @@ Notify the app when the timezone changes, defaults to `false`.
272282
android.maxLogcatObjectSize: number = 9999;
273283
```
274284

275-
Sets the maximum lenght of a single output string. Defaults to `1024`.
285+
Sets the max length of a single output string. Defaults to `1024`.
276286

277287
### android.forceLog
278288

@@ -336,7 +346,7 @@ See also [android.id](#android-id).
336346
ios.discardUncaughtJsExceptions: boolean = true;
337347
```
338348

339-
Discard any uncaught JS exceptions. This can be very useful in production environments where you don't want your app to crash in case an unexpected JS exception is thrown.
349+
Discard any uncaught JS exceptions. This can be useful in production environments where you don't want your app to crash in case an unexpected JS exception is thrown.
340350

341351
### ios.SPMPackages
342352

@@ -391,12 +401,12 @@ Avaialable hooks (prefix with `before-` or `after-`):
391401
- `buildAndroidPlugin` - Builds aar file for Android plugin, runs during prepareNativeApp
392402
- `buildAndroid` - Builds Android app
393403
- `buildIOS` - Builds iOS app
394-
- `checkEnvironment` - Validate project env, runs during ns doctor, clean, and most build commands
404+
- `checkEnvironment` - Validate project env, runs during `ns` doctor, clean, and most build commands
395405
- `checkForChanges` - Changes occurred during watch
396406
- `install` - Application installed to device/emulator
397407
- `prepare` - Compiles webpack and prepares native app in platforms folder
398408
- `prepareNativeApp` - Preparing the actual native app, runs during prepare/watch hook
399-
- `resolveCommand` - Resolves command and arguments, runs before all cli commands
409+
- `resolveCommand` - Resolves command and arguments, runs before all CLI commands
400410
- `watch` - Setup watchers for live sync, runs during prepare hook
401411
- `watchPatterns` - Setup watch patterns, runs during watch hook
402412

content/configuration/webpack.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ We define a few useful globally available variables that you can use to alter lo
127127
- `__NS_WEBPACK__` - always `true` when building with webpack
128128
- `__NS_ENV_VERBOSE__` - `true` when `--env.verbose` is set
129129
- `__NS_DEV_HOST_IPS__` - an array of IP addresses of the host machine (the machine running the build) when in `development` mode, and an empty array in production mode.
130-
- `__CSS_PARSER__` - the css parser used by NativeScript Core. The value is set based on the `cssParser` value in the `nativescript.config.ts` and defaults to `css-tree`
130+
- `__CSS_PARSER__` - the CSS parser used by NativeScript Core. The value is set based on the `cssParser` value in the `nativescript.config.ts` and defaults to `css-tree`
131131
- `__UI_USE_XML_PARSER__` - a flag used by NativeScript Core to disable the XML parser when it's not used
132132
- `__UI_USE_EXTERNAL_RENDERER__` - a flag used by NativeScript Core to disable registering global modules when an external renderer is used.
133133

@@ -486,7 +486,7 @@ module.exports = (env) => {
486486

487487
In some cases, you may want to explicitly set which base config should be used.
488488

489-
For example in the NativeScript-Vue repo, the `sample` app doesn't have `nativescript-vue` listed as a dependency, so we have to specify the base config we want to use.
489+
For example in the NativeScript-Vue repository, the `sample` app doesn't have `nativescript-vue` listed as a dependency, so we have to specify the base config we want to use.
490490

491491
```js
492492
const webpack = require('@nativescript/webpack')
@@ -528,6 +528,8 @@ module.exports = (env) => {
528528

529529
### Merging options into the config
530530

531+
<!--alex ignore simple-->
532+
531533
For simple things, you can merge objects into the final config instead of using `chainWebpack`
532534

533535
```js

content/guide/code-sharing.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ contributors:
55
- NathanWalker
66
---
77

8+
<!-- textlint-disable terminology -->
9+
810
JavaScript provides opportunities of immense scalability if architectured properly. One key word that often comes up in this department is **"code sharing"**. Over the years, several lessons have emerged around scalability with JavaScript in lieu of NativeScript in particular.
911

1012
**The NativeScript TSC's 5 fundamental lessons about good code sharing**:
1113

1214
1. If you can share your code easily with other paradigms, other disciplines, other runtimes even, then you have a good code sharing approach that will continue to provide you and your team joy. No developer or team willingly gets into code sharing hoping to find themselves in a corner later. You always want to share now to more easily maintain and scale the code later.
13-
2. A good code sharing approach should fit naturally in with well supported community standards and not require any extra build tooling just for the sharability to support itself. It should, in other words, stand firmly on it's own in scope of the language it is written in.
15+
2. A good code sharing approach should fit naturally in with well supported community standards and not require any extra build tooling for the sharability to support itself. It should, in other words, stand firmly on it's own in scope of the language it is written in.
1416
3. A good code sharing approach should not have to introduce new file extensions purely for sake of sharability (outside of those naturally supported by the framework) to deal with. All team's organize code by folders naturally and the same should be matched with good code sharing approaches avoiding new file extensions and concepts that go beyond general code organization.
1517
4. A good code sharing approach should clearly identify deployment/distribution lines as well as distinct platform separation allowing various shared code segments to have clear designated deployment targets allowing teams to control their own sophisticated build pipelines as they desire. Further the shared code should live within a thoughtful organizational structure that supports the ability to scale and adapt to future needs aside from the deployment targets that use the shared code.
1618
5. Within the specific scope of NativeScript's viewpoint, JavaScript is the universal language which provides the opportunity to share code effectively and responsibly. An approach that is based fundamentally on the strengths of JavaScript (and inherently TypeScript) is a good code sharing approach.
@@ -32,7 +34,7 @@ Here are a few solitions to **code-sharing**, each having their pros and cons.
3234
**Pros:**
3335

3436
- It's centered around JavaScript/TypeScript (lesson 1 and 5 above)
35-
- Uses standard build tooling like typescript or webpack to build code (lesson 2 above)
37+
- Uses standard build tooling like TypeScript or webpack to build code (lesson 2 above)
3638
- No custom file extensions to deal with (lesson 3 above)
3739
- Nx splits up "apps" and "libs" clearly identifying deployment/distribution targets "apps" that consume shared code "libs" (lesson 4 above)
3840

@@ -47,7 +49,7 @@ Here are a few solitions to **code-sharing**, each having their pros and cons.
4749
**Pros:**
4850

4951
- It's centered around JavaScript/TypeScript (lesson 1 and 5 above)
50-
- Uses standard build tooling like typescript or webpack to build code (lesson 2 above)
52+
- Uses standard build tooling like TypeScript or webpack to build code (lesson 2 above)
5153
- No custom file extensions to deal with (lesson 3 above)
5254
- Nx splits up "apps" and "libs" clearly identifying deployment/distribution targets "apps" that consume shared code "libs" (lesson 4 above)
5355
- It builds upon @nativescript/nx to further scale it across more paradigms so it's a natural extension when needed if already working in Nx with @nativescript/nx
@@ -66,7 +68,7 @@ Here are a few solitions to **code-sharing**, each having their pros and cons.
6668
**Pros:**
6769

6870
- It's centered around JavaScript/TypeScript (lesson 1 and 5 above)
69-
- Uses standard build tooling like typescript or webpack to build code (lesson 2 above)
71+
- Uses standard build tooling like TypeScript or webpack to build code (lesson 2 above)
7072
- No custom file extensions to deal with (lesson 3 above)
7173
- Can link/share dependencies
7274

@@ -82,7 +84,7 @@ Here are a few solitions to **code-sharing**, each having their pros and cons.
8284
**Pros:**
8385

8486
- It's centered around JavaScript/TypeScript (lesson 1 and 5 above)
85-
- Uses standard build tooling like typescript or webpack to build code (lesson 2 above)
87+
- Uses standard build tooling like TypeScript or webpack to build code (lesson 2 above)
8688
- No custom file extensions to deal with (lesson 3 above)
8789

8890
**Cons:**

content/guide/creating-a-project.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ns create myCoolApp --template @nativescript/template-blank
6262

6363
### Drawer Template
6464

65-
A simple template with a side drawer.
65+
A template with a side drawer.
6666

6767
<!-- TODO: make nicer images -->
6868

@@ -81,7 +81,7 @@ ns create myCoolApp --template @nativescript/template-drawer-navigation
8181

8282
### Tabs Template
8383

84-
A simple template with multiple tabs.
84+
A template with multiple tabs.
8585

8686
<!-- TODO: make nicer images -->
8787

@@ -100,7 +100,8 @@ ns create myCoolApp --template @nativescript/template-tab-navigation
100100

101101
### List & Details Template
102102

103-
A simple template with a ListView and a details screen.
103+
A template with a ListView and a details screen.
104+
104105
<DeviceFrame type="ios">
105106
<img src="https://raw.githubusercontent.com/NativeScript/nativescript-app-templates/master/packages/template-master-detail/tools/assets/appTemplate-ios.png">
106107
</DeviceFrame>

content/guide/debugging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ If you are new to JavaScript debugging, we recommend reading the following resou
8585
| Memory Profiling | :white_check_mark: | :white_check_mark: |
8686
| Timeline and CPU Profiling | :white_check_mark: | :white_check_mark: |
8787

88-
## Debugging with VSCode
88+
## Debugging with VS Code
8989

90-
VSCode uses the same protocol as the Chrome DevTools, in order to start a debugging session in VSCode you need to install the [NativeScript extension for VS Code](https://marketplace.visualstudio.com/items?itemName=NativeScript.nativescript).
90+
VS Code uses the same protocol as the Chrome DevTools, in order to start a debugging session in VS Code you need to install the [NativeScript extension for VS Code](https://marketplace.visualstudio.com/items?itemName=NativeScript.nativescript).
9191

9292
::: warning Note
93-
The VSCode extension for NativeScript is currently outdated and may not work. We are planning on revamping the project and bring it up-to-date with all the latest features soon.
93+
The VS Code extension for NativeScript is currently outdated and may not work. We are planning on revamping the project and bring it up-to-date with all the latest features soon.
9494
:::
9595

9696
## Debugging with XCode

content/guide/multithreading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Workers API in NativeScript is loosely based on the [Web Workers API](https:
1515
For optimal results when using the Workers API, follow these guidelines:
1616

1717
- Always make sure you close the worker threads, using the appropriate API (`terminate()` or `close()`), when the worker's finished its job. If Worker instances become unreachable in the scope you are working in before you are able to terminate it, you will be able to close it only from inside the worker script itself by calling the `close()` function.
18-
- Workers are not a general solution for all performance-related problems. Starting a Worker has an overhead of its own, and may sometimes be slower than just processing a quick task. Optimize DB queries, or rethink complex application logic before resorting to workers.
18+
- Workers are not a general solution for all performance-related problems. Starting a Worker has an overhead of its own, and may sometimes be slower than processing a quick task. Optimize DB queries, or rethink complex application logic before resorting to workers.
1919
- Since worker threads have access to the entire native SDK, the NativeScript developer must take care of all the synchronization when calling APIs which are not guaranteed to be thread-safe from more than one thread.
2020

2121
## Using Workers

0 commit comments

Comments
 (0)