From c05b5ecf45f3bdb62c93b6c614084f7773cec6ad Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 27 Jun 2022 21:48:54 +0000 Subject: [PATCH 01/55] Update react to output generated at 0403b1a --- .stackblitzrc | 4 + nativescript.config.ts | 11 ++ package.json | 26 ++++ patches/@types+react+16.9.34.patch | 192 ++++++++++++++++++++++++++ references.d.ts | 1 + src/app.css | 4 + src/app.ts | 9 ++ src/components/HomeScreen.tsx | 52 +++++++ src/components/NavigationParamList.ts | 4 + src/components/Navigator.tsx | 30 ++++ src/components/SecondaryScreen.tsx | 44 ++++++ tsconfig.json | 21 +++ webpack.config.js | 10 ++ 13 files changed, 408 insertions(+) create mode 100644 .stackblitzrc create mode 100644 nativescript.config.ts create mode 100644 package.json create mode 100644 patches/@types+react+16.9.34.patch create mode 100644 references.d.ts create mode 100644 src/app.css create mode 100644 src/app.ts create mode 100644 src/components/HomeScreen.tsx create mode 100644 src/components/NavigationParamList.ts create mode 100644 src/components/Navigator.tsx create mode 100644 src/components/SecondaryScreen.tsx create mode 100644 tsconfig.json create mode 100644 webpack.config.js diff --git a/.stackblitzrc b/.stackblitzrc new file mode 100644 index 0000000..24b9da3 --- /dev/null +++ b/.stackblitzrc @@ -0,0 +1,4 @@ +{ + "installDependencies": true, + "startCommand": "./node_modules/.bin/preview-cli --config=https://preview.nativescript.org/api/config" +} diff --git a/nativescript.config.ts b/nativescript.config.ts new file mode 100644 index 0000000..2ea32d6 --- /dev/null +++ b/nativescript.config.ts @@ -0,0 +1,11 @@ +import { NativeScriptConfig } from '@nativescript/core'; + +export default { + id: 'org.nativescript.app', + appPath: 'src', + appResourcesPath: 'App_Resources', + android: { + v8Flags: '--expose_gc', + markingMode: 'none' + } +} as NativeScriptConfig; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..d03c40a --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "stackblitz-nativescript-react", + "main": "src/app.ts", + "version": "1.0.0", + "private": true, + "dependencies": { + "@nativescript/core": "~8.2.0", + "@react-navigation/core": "^5.15.3", + "react": "~16.13.1", + "react-nativescript": "^3.0.0-beta.1", + "react-nativescript-navigation": "3.0.0-beta.2" + }, + "devDependencies": { + "@nativescript/preview-cli": "^1.0.0-beta.15", + "@nativescript/types-minimal": "^8.2.0", + "@nativescript/webpack": "^5.0.7-alpha.3", + "@types/react": "16.9.34", + "patch-package": "~6.4.7", + "typescript": "~4.5.5" + }, + "scripts": { + "postinstall": "patch-package", + "type-check": "tsc --noEmit", + "type-check:watch": "npm run type-check -- --watch" + } +} diff --git a/patches/@types+react+16.9.34.patch b/patches/@types+react+16.9.34.patch new file mode 100644 index 0000000..6b87892 --- /dev/null +++ b/patches/@types+react+16.9.34.patch @@ -0,0 +1,192 @@ +diff --git a/node_modules/@types/react/index.d.ts b/node_modules/@types/react/index.d.ts +index 72c43ea..c4271cc 100644 +--- a/node_modules/@types/react/index.d.ts ++++ b/node_modules/@types/react/index.d.ts +@@ -2963,186 +2963,8 @@ declare global { + // tslint:disable-next-line:no-empty-interface + interface IntrinsicClassAttributes extends React.ClassAttributes { } + ++ // tslint:disable-next-line:no-empty-interface + interface IntrinsicElements { +- // HTML +- a: React.DetailedHTMLProps, HTMLAnchorElement>; +- abbr: React.DetailedHTMLProps, HTMLElement>; +- address: React.DetailedHTMLProps, HTMLElement>; +- area: React.DetailedHTMLProps, HTMLAreaElement>; +- article: React.DetailedHTMLProps, HTMLElement>; +- aside: React.DetailedHTMLProps, HTMLElement>; +- audio: React.DetailedHTMLProps, HTMLAudioElement>; +- b: React.DetailedHTMLProps, HTMLElement>; +- base: React.DetailedHTMLProps, HTMLBaseElement>; +- bdi: React.DetailedHTMLProps, HTMLElement>; +- bdo: React.DetailedHTMLProps, HTMLElement>; +- big: React.DetailedHTMLProps, HTMLElement>; +- blockquote: React.DetailedHTMLProps, HTMLElement>; +- body: React.DetailedHTMLProps, HTMLBodyElement>; +- br: React.DetailedHTMLProps, HTMLBRElement>; +- button: React.DetailedHTMLProps, HTMLButtonElement>; +- canvas: React.DetailedHTMLProps, HTMLCanvasElement>; +- caption: React.DetailedHTMLProps, HTMLElement>; +- cite: React.DetailedHTMLProps, HTMLElement>; +- code: React.DetailedHTMLProps, HTMLElement>; +- col: React.DetailedHTMLProps, HTMLTableColElement>; +- colgroup: React.DetailedHTMLProps, HTMLTableColElement>; +- data: React.DetailedHTMLProps, HTMLDataElement>; +- datalist: React.DetailedHTMLProps, HTMLDataListElement>; +- dd: React.DetailedHTMLProps, HTMLElement>; +- del: React.DetailedHTMLProps, HTMLElement>; +- details: React.DetailedHTMLProps, HTMLElement>; +- dfn: React.DetailedHTMLProps, HTMLElement>; +- dialog: React.DetailedHTMLProps, HTMLDialogElement>; +- div: React.DetailedHTMLProps, HTMLDivElement>; +- dl: React.DetailedHTMLProps, HTMLDListElement>; +- dt: React.DetailedHTMLProps, HTMLElement>; +- em: React.DetailedHTMLProps, HTMLElement>; +- embed: React.DetailedHTMLProps, HTMLEmbedElement>; +- fieldset: React.DetailedHTMLProps, HTMLFieldSetElement>; +- figcaption: React.DetailedHTMLProps, HTMLElement>; +- figure: React.DetailedHTMLProps, HTMLElement>; +- footer: React.DetailedHTMLProps, HTMLElement>; +- form: React.DetailedHTMLProps, HTMLFormElement>; +- h1: React.DetailedHTMLProps, HTMLHeadingElement>; +- h2: React.DetailedHTMLProps, HTMLHeadingElement>; +- h3: React.DetailedHTMLProps, HTMLHeadingElement>; +- h4: React.DetailedHTMLProps, HTMLHeadingElement>; +- h5: React.DetailedHTMLProps, HTMLHeadingElement>; +- h6: React.DetailedHTMLProps, HTMLHeadingElement>; +- head: React.DetailedHTMLProps, HTMLHeadElement>; +- header: React.DetailedHTMLProps, HTMLElement>; +- hgroup: React.DetailedHTMLProps, HTMLElement>; +- hr: React.DetailedHTMLProps, HTMLHRElement>; +- html: React.DetailedHTMLProps, HTMLHtmlElement>; +- i: React.DetailedHTMLProps, HTMLElement>; +- iframe: React.DetailedHTMLProps, HTMLIFrameElement>; +- img: React.DetailedHTMLProps, HTMLImageElement>; +- input: React.DetailedHTMLProps, HTMLInputElement>; +- ins: React.DetailedHTMLProps, HTMLModElement>; +- kbd: React.DetailedHTMLProps, HTMLElement>; +- keygen: React.DetailedHTMLProps, HTMLElement>; +- label: React.DetailedHTMLProps, HTMLLabelElement>; +- legend: React.DetailedHTMLProps, HTMLLegendElement>; +- li: React.DetailedHTMLProps, HTMLLIElement>; +- link: React.DetailedHTMLProps, HTMLLinkElement>; +- main: React.DetailedHTMLProps, HTMLElement>; +- map: React.DetailedHTMLProps, HTMLMapElement>; +- mark: React.DetailedHTMLProps, HTMLElement>; +- menu: React.DetailedHTMLProps, HTMLElement>; +- menuitem: React.DetailedHTMLProps, HTMLElement>; +- meta: React.DetailedHTMLProps, HTMLMetaElement>; +- meter: React.DetailedHTMLProps, HTMLElement>; +- nav: React.DetailedHTMLProps, HTMLElement>; +- noindex: React.DetailedHTMLProps, HTMLElement>; +- noscript: React.DetailedHTMLProps, HTMLElement>; +- object: React.DetailedHTMLProps, HTMLObjectElement>; +- ol: React.DetailedHTMLProps, HTMLOListElement>; +- optgroup: React.DetailedHTMLProps, HTMLOptGroupElement>; +- option: React.DetailedHTMLProps, HTMLOptionElement>; +- output: React.DetailedHTMLProps, HTMLElement>; +- p: React.DetailedHTMLProps, HTMLParagraphElement>; +- param: React.DetailedHTMLProps, HTMLParamElement>; +- picture: React.DetailedHTMLProps, HTMLElement>; +- pre: React.DetailedHTMLProps, HTMLPreElement>; +- progress: React.DetailedHTMLProps, HTMLProgressElement>; +- q: React.DetailedHTMLProps, HTMLQuoteElement>; +- rp: React.DetailedHTMLProps, HTMLElement>; +- rt: React.DetailedHTMLProps, HTMLElement>; +- ruby: React.DetailedHTMLProps, HTMLElement>; +- s: React.DetailedHTMLProps, HTMLElement>; +- samp: React.DetailedHTMLProps, HTMLElement>; +- slot: React.DetailedHTMLProps, HTMLSlotElement>; +- script: React.DetailedHTMLProps, HTMLScriptElement>; +- section: React.DetailedHTMLProps, HTMLElement>; +- select: React.DetailedHTMLProps, HTMLSelectElement>; +- small: React.DetailedHTMLProps, HTMLElement>; +- source: React.DetailedHTMLProps, HTMLSourceElement>; +- span: React.DetailedHTMLProps, HTMLSpanElement>; +- strong: React.DetailedHTMLProps, HTMLElement>; +- style: React.DetailedHTMLProps, HTMLStyleElement>; +- sub: React.DetailedHTMLProps, HTMLElement>; +- summary: React.DetailedHTMLProps, HTMLElement>; +- sup: React.DetailedHTMLProps, HTMLElement>; +- table: React.DetailedHTMLProps, HTMLTableElement>; +- template: React.DetailedHTMLProps, HTMLTemplateElement>; +- tbody: React.DetailedHTMLProps, HTMLTableSectionElement>; +- td: React.DetailedHTMLProps, HTMLTableDataCellElement>; +- textarea: React.DetailedHTMLProps, HTMLTextAreaElement>; +- tfoot: React.DetailedHTMLProps, HTMLTableSectionElement>; +- th: React.DetailedHTMLProps, HTMLTableHeaderCellElement>; +- thead: React.DetailedHTMLProps, HTMLTableSectionElement>; +- time: React.DetailedHTMLProps, HTMLElement>; +- title: React.DetailedHTMLProps, HTMLTitleElement>; +- tr: React.DetailedHTMLProps, HTMLTableRowElement>; +- track: React.DetailedHTMLProps, HTMLTrackElement>; +- u: React.DetailedHTMLProps, HTMLElement>; +- ul: React.DetailedHTMLProps, HTMLUListElement>; +- "var": React.DetailedHTMLProps, HTMLElement>; +- video: React.DetailedHTMLProps, HTMLVideoElement>; +- wbr: React.DetailedHTMLProps, HTMLElement>; +- webview: React.DetailedHTMLProps, HTMLWebViewElement>; +- +- // SVG +- svg: React.SVGProps; +- +- animate: React.SVGProps; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now. +- animateMotion: React.SVGProps; +- animateTransform: React.SVGProps; // TODO: It is SVGAnimateTransformElement but is not in TypeScript's lib.dom.d.ts for now. +- circle: React.SVGProps; +- clipPath: React.SVGProps; +- defs: React.SVGProps; +- desc: React.SVGProps; +- ellipse: React.SVGProps; +- feBlend: React.SVGProps; +- feColorMatrix: React.SVGProps; +- feComponentTransfer: React.SVGProps; +- feComposite: React.SVGProps; +- feConvolveMatrix: React.SVGProps; +- feDiffuseLighting: React.SVGProps; +- feDisplacementMap: React.SVGProps; +- feDistantLight: React.SVGProps; +- feDropShadow: React.SVGProps; +- feFlood: React.SVGProps; +- feFuncA: React.SVGProps; +- feFuncB: React.SVGProps; +- feFuncG: React.SVGProps; +- feFuncR: React.SVGProps; +- feGaussianBlur: React.SVGProps; +- feImage: React.SVGProps; +- feMerge: React.SVGProps; +- feMergeNode: React.SVGProps; +- feMorphology: React.SVGProps; +- feOffset: React.SVGProps; +- fePointLight: React.SVGProps; +- feSpecularLighting: React.SVGProps; +- feSpotLight: React.SVGProps; +- feTile: React.SVGProps; +- feTurbulence: React.SVGProps; +- filter: React.SVGProps; +- foreignObject: React.SVGProps; +- g: React.SVGProps; +- image: React.SVGProps; +- line: React.SVGProps; +- linearGradient: React.SVGProps; +- marker: React.SVGProps; +- mask: React.SVGProps; +- metadata: React.SVGProps; +- mpath: React.SVGProps; +- path: React.SVGProps; +- pattern: React.SVGProps; +- polygon: React.SVGProps; +- polyline: React.SVGProps; +- radialGradient: React.SVGProps; +- rect: React.SVGProps; +- stop: React.SVGProps; +- switch: React.SVGProps; +- symbol: React.SVGProps; +- text: React.SVGProps; +- textPath: React.SVGProps; +- tspan: React.SVGProps; +- use: React.SVGProps; +- view: React.SVGProps; + } + } + } diff --git a/references.d.ts b/references.d.ts new file mode 100644 index 0000000..5e8adff --- /dev/null +++ b/references.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/app.css b/src/app.css new file mode 100644 index 0000000..b7c9411 --- /dev/null +++ b/src/app.css @@ -0,0 +1,4 @@ +ActionBar { + background-color: #65adf1; + color: white; +} \ No newline at end of file diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..f037160 --- /dev/null +++ b/src/app.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; + +/* Controls react-nativescript log verbosity. true: all logs; false: only error logs. */ +Object.defineProperty(global, '__DEV__', { value: false }); + +import * as ReactNativeScript from 'react-nativescript'; +import { mainStackNavigator as AppContainer } from './components/Navigator'; + +ReactNativeScript.start(React.createElement(AppContainer, {}, null)); diff --git a/src/components/HomeScreen.tsx b/src/components/HomeScreen.tsx new file mode 100644 index 0000000..ff0529f --- /dev/null +++ b/src/components/HomeScreen.tsx @@ -0,0 +1,52 @@ +import * as React from "react"; +import { RouteProp } from '@react-navigation/core'; +import { Dialogs } from '@nativescript/core'; +import { FrameNavigationProp } from "react-nativescript-navigation"; +import { StyleSheet } from "react-nativescript"; +import { MainStackParamList } from "./NavigationParamList"; + +type HomeScreenProps = { + route: RouteProp, + navigation: FrameNavigationProp, +} + +export function HomeScreen({ navigation }: HomeScreenProps) { + return ( + + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + height: "100%", + flexDirection: "column", + justifyContent: "center", + }, + text: { + textAlignment: "center", + fontSize: 24, + color: "black", + }, + button: { + fontSize: 24, + color: "#2e6ddf", + }, +}); \ No newline at end of file diff --git a/src/components/NavigationParamList.ts b/src/components/NavigationParamList.ts new file mode 100644 index 0000000..95133a7 --- /dev/null +++ b/src/components/NavigationParamList.ts @@ -0,0 +1,4 @@ +export type MainStackParamList = { + Home: {} + Secondary: {} +} diff --git a/src/components/Navigator.tsx b/src/components/Navigator.tsx new file mode 100644 index 0000000..bd5f9ed --- /dev/null +++ b/src/components/Navigator.tsx @@ -0,0 +1,30 @@ +import * as React from "react"; +import { BaseNavigationContainer } from '@react-navigation/core'; +import { stackNavigatorFactory } from "react-nativescript-navigation"; +import { HomeScreen } from "./HomeScreen"; +import { SecondaryScreen } from "./SecondaryScreen"; + +const StackNavigator = stackNavigatorFactory(); + +export const mainStackNavigator = () => ( + + + + + + +); diff --git a/src/components/SecondaryScreen.tsx b/src/components/SecondaryScreen.tsx new file mode 100644 index 0000000..43ebdd7 --- /dev/null +++ b/src/components/SecondaryScreen.tsx @@ -0,0 +1,44 @@ +import * as React from "react"; +import { RouteProp } from '@react-navigation/core'; +import { FrameNavigationProp } from "react-nativescript-navigation"; +import { MainStackParamList } from "./NavigationParamList"; +import { StyleSheet } from "react-nativescript"; + +type SecondaryScreenProps = { + route: RouteProp, + navigation: FrameNavigationProp, +} + +export function SecondaryScreen({ navigation }: SecondaryScreenProps) { + return ( + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + height: "100%", + flexDirection: "column", + justifyContent: "center", + backgroundColor: "yellow", + }, + text: { + textAlignment: "center", + fontSize: 24, + color: "black", + }, + button: { + fontSize: 24, + color: "#2e6ddf", + }, +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..abf62d5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "esnext", + "target": "es2017", + "moduleResolution": "node", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noEmitHelpers": true, + "noEmitOnError": true, + "jsx": "react", + "lib": ["es2017", "dom"], + "baseUrl": ".", + "paths": { + "~/*": ["src/*"], + "@/*": ["src/*"] + } + }, + "include": ["./src/**/*.tsx?"], + "files": ["./references.d.ts"], + "exclude": ["node_modules", "platforms"] +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..b80dc7f --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,10 @@ +const webpack = require('@nativescript/webpack'); + +module.exports = (env) => { + webpack.init(env); + + // Learn how to customize: + // https://docs.nativescript.org/webpack + + return webpack.resolveConfig(); +}; From 9e28c2581ec71e6558372fd2e764076a395ce689 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 27 Jun 2022 21:50:29 +0000 Subject: [PATCH 02/55] chore(update): react to 5f4fa22 From a19a3f81034d31dc87c96f6a5e5f07a06ba18477 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 27 Jun 2022 22:54:42 +0000 Subject: [PATCH 03/55] chore(update): react to 4aaefc6 From 7ad328bafbedb922e9ecf6f9a530cb96ba89a52f Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 27 Jun 2022 23:07:23 +0000 Subject: [PATCH 04/55] chore(update): react to 7fd42be From 90ff04b9d15815d57a9de6fdcfdceb2f477636df Mon Sep 17 00:00:00 2001 From: rigor789 Date: Tue, 28 Jun 2022 19:35:22 +0000 Subject: [PATCH 05/55] chore(update): react to 37b55c3 --- .stackblitzrc | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stackblitzrc b/.stackblitzrc index 24b9da3..a8f1f46 100644 --- a/.stackblitzrc +++ b/.stackblitzrc @@ -1,4 +1,4 @@ { "installDependencies": true, - "startCommand": "./node_modules/.bin/preview-cli --config=https://preview.nativescript.org/api/config" + "startCommand": "./node_modules/.bin/setup-nativescript-stackblitz && ns preview" } diff --git a/package.json b/package.json index d03c40a..d9b5c08 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "react-nativescript-navigation": "3.0.0-beta.2" }, "devDependencies": { - "@nativescript/preview-cli": "^1.0.0-beta.15", + "@nativescript/preview-cli": "*", + "@nativescript/stackblitz": "*", "@nativescript/types-minimal": "^8.2.0", "@nativescript/webpack": "^5.0.7-alpha.3", "@types/react": "16.9.34", From c9e40074595ad9622ce8fb69de381d65be63e33c Mon Sep 17 00:00:00 2001 From: rigor789 Date: Fri, 1 Jul 2022 10:16:44 +0000 Subject: [PATCH 06/55] chore(update): react to da51e34 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9b5c08..c7594fe 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@nativescript/preview-cli": "*", "@nativescript/stackblitz": "*", "@nativescript/types-minimal": "^8.2.0", - "@nativescript/webpack": "^5.0.7-alpha.3", + "@nativescript/webpack": "alpha", "@types/react": "16.9.34", "patch-package": "~6.4.7", "typescript": "~4.5.5" From f5f4341078f60e4341b2936791ccebd52097a2bf Mon Sep 17 00:00:00 2001 From: NathanWalker Date: Fri, 1 Jul 2022 21:32:41 +0000 Subject: [PATCH 07/55] chore(update): react to 3c971a9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7594fe..8cd7017 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@nativescript/preview-cli": "*", "@nativescript/stackblitz": "*", - "@nativescript/types-minimal": "^8.2.0", + "@nativescript/types-minimal": "^8.2.1", "@nativescript/webpack": "alpha", "@types/react": "16.9.34", "patch-package": "~6.4.7", From f17a22ab235b74c1d30a50782133447ef71e6f03 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Fri, 1 Jul 2022 21:54:37 +0000 Subject: [PATCH 08/55] chore(update): react to ca73ccf --- .stackblitzrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.stackblitzrc b/.stackblitzrc index a8f1f46..86b9dd3 100644 --- a/.stackblitzrc +++ b/.stackblitzrc @@ -1,4 +1,5 @@ { "installDependencies": true, + "compileTrigger": "save", "startCommand": "./node_modules/.bin/setup-nativescript-stackblitz && ns preview" } From 7b8c6eb3f2d6f69f4c0057a9c8dcc71aaf456a7d Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 18 Jul 2022 21:49:09 +0000 Subject: [PATCH 09/55] chore(update): react to 474a22b --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8cd7017..e92a8f9 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "react-nativescript-navigation": "3.0.0-beta.2" }, "devDependencies": { - "@nativescript/preview-cli": "*", - "@nativescript/stackblitz": "*", + "@nativescript/preview-cli": "1.0.0-beta.18", + "@nativescript/stackblitz": "0.0.5", "@nativescript/types-minimal": "^8.2.1", "@nativescript/webpack": "alpha", "@types/react": "16.9.34", From db0249d611f347580975de995cb0dd3f3a5dcb43 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Wed, 10 Aug 2022 10:07:06 +0000 Subject: [PATCH 10/55] chore(update): react to dfc29ce From 953b562979806b8ee59fa46098da4912fc9772bd Mon Sep 17 00:00:00 2001 From: rigor789 Date: Wed, 10 Aug 2022 10:15:38 +0000 Subject: [PATCH 11/55] chore(update): react to aa82a21 --- .gitignore | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cb1231 --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +# NativeScript +hooks/ +node_modules/ +platforms/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# General +.DS_Store +.AppleDouble +.LSOverride +.idea +.cloud +.project +tmp/ +typings/ + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json From 7da736280727574683475b5f7531f0bca410ca5c Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 15 Aug 2022 15:10:38 +0000 Subject: [PATCH 12/55] chore(update): react to 86f6ddd --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e92a8f9..70a0782 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "react-nativescript-navigation": "3.0.0-beta.2" }, "devDependencies": { - "@nativescript/preview-cli": "1.0.0-beta.18", + "@nativescript/preview-cli": "1.0.0-rc.0", "@nativescript/stackblitz": "0.0.5", "@nativescript/types-minimal": "^8.2.1", "@nativescript/webpack": "alpha", From ab470e758455fc5ab7a716cf142906370c68f026 Mon Sep 17 00:00:00 2001 From: NathanWalker Date: Mon, 15 Aug 2022 20:06:21 +0000 Subject: [PATCH 13/55] chore(update): react to 800364f --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 70a0782..a30847c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "private": true, "dependencies": { - "@nativescript/core": "~8.2.0", + "@nativescript/core": "~8.3.0", "@react-navigation/core": "^5.15.3", "react": "~16.13.1", "react-nativescript": "^3.0.0-beta.1", @@ -13,8 +13,8 @@ "devDependencies": { "@nativescript/preview-cli": "1.0.0-rc.0", "@nativescript/stackblitz": "0.0.5", - "@nativescript/types-minimal": "^8.2.1", - "@nativescript/webpack": "alpha", + "@nativescript/types-minimal": "~8.3.0", + "@nativescript/webpack": "~5.0.0", "@types/react": "16.9.34", "patch-package": "~6.4.7", "typescript": "~4.5.5" From 3249fd2fd839e8fdfa591ee0108157db81646459 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Wed, 17 Aug 2022 20:23:55 +0000 Subject: [PATCH 14/55] chore(update): react to ecfe51d --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a30847c..44a7f12 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "react-nativescript-navigation": "3.0.0-beta.2" }, "devDependencies": { - "@nativescript/preview-cli": "1.0.0-rc.0", + "@nativescript/preview-cli": "1.0.0", "@nativescript/stackblitz": "0.0.5", "@nativescript/types-minimal": "~8.3.0", "@nativescript/webpack": "~5.0.0", From 3850728aa2b8bbd55861717a7d05ef4237053d73 Mon Sep 17 00:00:00 2001 From: NathanWalker Date: Sun, 28 Aug 2022 02:39:56 +0000 Subject: [PATCH 15/55] chore(update): react to 07fc54f From b1aed234e21c7ed3abd1eea015f97a7d9130fa77 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Tue, 30 Aug 2022 17:17:22 +0000 Subject: [PATCH 16/55] chore(update): react to 1e24c01 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 44a7f12..d78c0b8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "react-nativescript-navigation": "3.0.0-beta.2" }, "devDependencies": { - "@nativescript/preview-cli": "1.0.0", + "@nativescript/preview-cli": "1.0.1", "@nativescript/stackblitz": "0.0.5", "@nativescript/types-minimal": "~8.3.0", "@nativescript/webpack": "~5.0.0", From 097becc0455d898badadd1bd45717a9281b81ebf Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 26 Sep 2022 17:23:38 +0000 Subject: [PATCH 17/55] chore(update): react to 8c5c52c From 73124e6ea9800bebce36228707c7852be4e0b2fa Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 26 Sep 2022 17:43:05 +0000 Subject: [PATCH 18/55] chore(update): react to c7a0008 From 1e2a1e1a03576199e5b68a87dfdf344109002e80 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 26 Sep 2022 17:46:21 +0000 Subject: [PATCH 19/55] chore(update): react to 8c014a9 From e776be1e0650a2d65b19966784398a06c8bef8d3 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 26 Sep 2022 17:50:10 +0000 Subject: [PATCH 20/55] chore(update): react to a5d4c92 --- package.json | 2 ++ src/app.css | 6 +++++- src/components/HomeScreen.tsx | 9 ++------- tailwind.config.js | 15 +++++++++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 tailwind.config.js diff --git a/package.json b/package.json index d78c0b8..2fb1806 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,12 @@ "devDependencies": { "@nativescript/preview-cli": "1.0.1", "@nativescript/stackblitz": "0.0.5", + "@nativescript/tailwind": "^2.0.1", "@nativescript/types-minimal": "~8.3.0", "@nativescript/webpack": "~5.0.0", "@types/react": "16.9.34", "patch-package": "~6.4.7", + "tailwindcss": "^3.1.8", "typescript": "~4.5.5" }, "scripts": { diff --git a/src/app.css b/src/app.css index b7c9411..b7df943 100644 --- a/src/app.css +++ b/src/app.css @@ -1,4 +1,8 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + ActionBar { background-color: #65adf1; color: white; -} \ No newline at end of file +} diff --git a/src/components/HomeScreen.tsx b/src/components/HomeScreen.tsx index ff0529f..f890f3c 100644 --- a/src/components/HomeScreen.tsx +++ b/src/components/HomeScreen.tsx @@ -14,7 +14,7 @@ export function HomeScreen({ navigation }: HomeScreenProps) { return ( @@ -40,13 +40,8 @@ const styles = StyleSheet.create({ flexDirection: "column", justifyContent: "center", }, - text: { - textAlignment: "center", - fontSize: 24, - color: "black", - }, button: { fontSize: 24, color: "#2e6ddf", }, -}); \ No newline at end of file +}); diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..eb1f540 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,15 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + './src/**/*.{css,xml,html,vue,svelte,ts,tsx}' + ], + // use .dark to toggle dark mode - since 'media' (default) does not work in NativeScript + darkMode: 'class', + theme: { + extend: {}, + }, + plugins: [], + corePlugins: { + preflight: false // disables browser-specific resets + } +} From c0a3099f01a76cf293dca6247ccdd0700ca7117c Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 26 Sep 2022 17:54:53 +0000 Subject: [PATCH 21/55] chore(update): react to a0dccbe From 2c8c86788f72d25ba78be95cd131a98cad85f30d Mon Sep 17 00:00:00 2001 From: rigor789 Date: Mon, 26 Sep 2022 17:57:26 +0000 Subject: [PATCH 22/55] chore(update): react to 73da163 From f71770d59c4bfc992be2daa20c950ceb90d709aa Mon Sep 17 00:00:00 2001 From: rigor789 Date: Tue, 4 Oct 2022 18:43:40 +0000 Subject: [PATCH 23/55] chore(update): react to 11ae202 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2fb1806..7b15bcd 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "react-nativescript-navigation": "3.0.0-beta.2" }, "devDependencies": { - "@nativescript/preview-cli": "1.0.1", + "@nativescript/preview-cli": "1.0.2", "@nativescript/stackblitz": "0.0.5", "@nativescript/tailwind": "^2.0.1", "@nativescript/types-minimal": "~8.3.0", From 6cfc80b953c9c238a4a90665459c0e74096d309b Mon Sep 17 00:00:00 2001 From: rigor789 Date: Thu, 6 Oct 2022 11:41:47 +0000 Subject: [PATCH 24/55] chore(update): react to fc6f483 --- tailwind.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tailwind.config.js b/tailwind.config.js index eb1f540..3a61b35 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,8 +3,8 @@ module.exports = { content: [ './src/**/*.{css,xml,html,vue,svelte,ts,tsx}' ], - // use .dark to toggle dark mode - since 'media' (default) does not work in NativeScript - darkMode: 'class', + // use the .ns-dark class to control dark mode (applied by NativeScript) - since 'media' (default) is not supported. + darkMode: ['class', '.ns-dark'], theme: { extend: {}, }, From 70e435fe47d842493e7885961ae105036e8d2c63 Mon Sep 17 00:00:00 2001 From: rigor789 Date: Thu, 6 Oct 2022 16:15:47 +0000 Subject: [PATCH 25/55] chore(update): react to 649831e --- package.json | 20 ++++++--------- src/NavigationParamList.ts | 9 +++++++ src/app.ts | 16 +++++++++--- .../{Navigator.tsx => MainStack.tsx} | 22 +++++++++------- src/components/NavigationParamList.ts | 4 --- .../{HomeScreen.tsx => ScreenOne.tsx} | 25 +++++++++---------- .../{SecondaryScreen.tsx => ScreenTwo.tsx} | 22 +++++++++------- 7 files changed, 67 insertions(+), 51 deletions(-) create mode 100644 src/NavigationParamList.ts rename src/components/{Navigator.tsx => MainStack.tsx} (65%) delete mode 100644 src/components/NavigationParamList.ts rename src/components/{HomeScreen.tsx => ScreenOne.tsx} (68%) rename src/components/{SecondaryScreen.tsx => ScreenTwo.tsx} (67%) diff --git a/package.json b/package.json index 7b15bcd..5077f92 100644 --- a/package.json +++ b/package.json @@ -4,26 +4,22 @@ "version": "1.0.0", "private": true, "dependencies": { - "@nativescript/core": "~8.3.0", - "@react-navigation/core": "^5.15.3", - "react": "~16.13.1", - "react-nativescript": "^3.0.0-beta.1", - "react-nativescript-navigation": "3.0.0-beta.2" + "@nativescript/core": "~8.3.5", + "react": "^16.14.0", + "react-nativescript": "^4.0.0", + "react-nativescript-navigation": "^4.0.0" }, "devDependencies": { "@nativescript/preview-cli": "1.0.2", "@nativescript/stackblitz": "0.0.5", "@nativescript/tailwind": "^2.0.1", "@nativescript/types-minimal": "~8.3.0", - "@nativescript/webpack": "~5.0.0", - "@types/react": "16.9.34", - "patch-package": "~6.4.7", + "@nativescript/webpack": "~5.0.8", + "@types/react": "npm:types-react-without-jsx-intrinsics@^16.14.30", "tailwindcss": "^3.1.8", - "typescript": "~4.5.5" + "typescript": "^4.8.4" }, "scripts": { - "postinstall": "patch-package", - "type-check": "tsc --noEmit", - "type-check:watch": "npm run type-check -- --watch" + "type-check": "tsc --noEmit" } } diff --git a/src/NavigationParamList.ts b/src/NavigationParamList.ts new file mode 100644 index 0000000..6547d0d --- /dev/null +++ b/src/NavigationParamList.ts @@ -0,0 +1,9 @@ +/** + * A record of the navigation params for each route in your app. + */ +export type MainStackParamList = { + One?: {}; + Two: { + message: string; + }; +}; diff --git a/src/app.ts b/src/app.ts index f037160..b739a9c 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,9 +1,17 @@ import * as React from 'react'; +import * as ReactNativeScript from 'react-nativescript'; +import { MainStack } from './components/MainStack'; + +// In NativeScript, the app.ts file is the entry point to your application. You +// can use this file to perform app-level initialization, but the primary +// purpose of the file is to pass control to the app’s first module. -/* Controls react-nativescript log verbosity. true: all logs; false: only error logs. */ +// Controls react-nativescript log verbosity. +// - true: all logs; +// - false: only error logs. Object.defineProperty(global, '__DEV__', { value: false }); -import * as ReactNativeScript from 'react-nativescript'; -import { mainStackNavigator as AppContainer } from './components/Navigator'; +ReactNativeScript.start(React.createElement(MainStack, {}, null)); -ReactNativeScript.start(React.createElement(AppContainer, {}, null)); +// Do not place any code after the application has been started as it will not +// be executed on iOS. diff --git a/src/components/Navigator.tsx b/src/components/MainStack.tsx similarity index 65% rename from src/components/Navigator.tsx rename to src/components/MainStack.tsx index bd5f9ed..89059f1 100644 --- a/src/components/Navigator.tsx +++ b/src/components/MainStack.tsx @@ -1,15 +1,19 @@ -import * as React from "react"; import { BaseNavigationContainer } from '@react-navigation/core'; +import * as React from "react"; import { stackNavigatorFactory } from "react-nativescript-navigation"; -import { HomeScreen } from "./HomeScreen"; -import { SecondaryScreen } from "./SecondaryScreen"; + +import { ScreenOne } from "./ScreenOne"; +import { ScreenTwo } from "./ScreenTwo"; const StackNavigator = stackNavigatorFactory(); -export const mainStackNavigator = () => ( +/** + * The main stack navigator for the whole app. + */ +export const MainStack = () => ( ( }} > diff --git a/src/components/NavigationParamList.ts b/src/components/NavigationParamList.ts deleted file mode 100644 index 95133a7..0000000 --- a/src/components/NavigationParamList.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type MainStackParamList = { - Home: {} - Secondary: {} -} diff --git a/src/components/HomeScreen.tsx b/src/components/ScreenOne.tsx similarity index 68% rename from src/components/HomeScreen.tsx rename to src/components/ScreenOne.tsx index f890f3c..6ddfbe6 100644 --- a/src/components/HomeScreen.tsx +++ b/src/components/ScreenOne.tsx @@ -1,21 +1,20 @@ -import * as React from "react"; -import { RouteProp } from '@react-navigation/core'; import { Dialogs } from '@nativescript/core'; -import { FrameNavigationProp } from "react-nativescript-navigation"; +import { RouteProp } from '@react-navigation/core'; +import * as React from "react"; import { StyleSheet } from "react-nativescript"; -import { MainStackParamList } from "./NavigationParamList"; +import { FrameNavigationProp } from "react-nativescript-navigation"; -type HomeScreenProps = { - route: RouteProp, - navigation: FrameNavigationProp, -} +import { MainStackParamList } from "../NavigationParamList"; -export function HomeScreen({ navigation }: HomeScreenProps) { +type ScreenOneProps = { + route: RouteProp, + navigation: FrameNavigationProp, +}; + +export function ScreenOne({ navigation }: ScreenOneProps) { return ( -