From c2df395e0043e35c51574ac204996d393ced2431 Mon Sep 17 00:00:00 2001 From: NathanWalker Date: Mon, 8 Apr 2024 16:29:17 +0000 Subject: [PATCH 01/14] chore(update): solid to f7c6783 --- .gitignore | 28 ++++++++++++++++++++++++++++ .npmrc | 1 + .stackblitzrc | 5 +++++ nativescript.config.ts | 11 +++++++++++ package.json | 29 +++++++++++++++++++++++++++++ src/app.css | 8 ++++++++ src/app.js | 11 +++++++++++ src/app.jsx | 34 ++++++++++++++++++++++++++++++++++ src/component.jsx | 13 +++++++++++++ tailwind.config.js | 14 ++++++++++++++ webpack.config.js | 7 +++++++ 11 files changed, 161 insertions(+) create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 .stackblitzrc create mode 100644 nativescript.config.ts create mode 100644 package.json create mode 100644 src/app.css create mode 100644 src/app.js create mode 100644 src/app.jsx create mode 100644 src/component.jsx create mode 100644 tailwind.config.js create mode 100644 webpack.config.js 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 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..e9ee3cb --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true \ No newline at end of file diff --git a/.stackblitzrc b/.stackblitzrc new file mode 100644 index 0000000..0c7b450 --- /dev/null +++ b/.stackblitzrc @@ -0,0 +1,5 @@ +{ + "installDependencies": true, + "compileTrigger": "save", + "startCommand": "setup-nativescript-stackblitz && ns preview" +} diff --git a/nativescript.config.ts b/nativescript.config.ts new file mode 100644 index 0000000..d05e128 --- /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; diff --git a/package.json b/package.json new file mode 100644 index 0000000..9132224 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "stackblitz-nativescript-solid", + "main": "src/app.js", + "version": "1.0.0", + "private": true, + "scripts": {}, + "dependencies": { + "@nativescript-community/solid-js": "^0.0.6", + "@nativescript/core": "~8.7.0", + "dominative": "^0.1.3", + "solid-js": "^1.8.16", + "undom-ng": "^1.1.2" + }, + "devDependencies": { + "@babel/core": "^7.24.4", + "@babel/preset-env": "^7.24.4", + "@babel/preset-typescript": "^7.24.1", + "@nativescript/preview-cli": "^1.0.13", + "@nativescript/stackblitz": "0.0.8", + "@nativescript/tailwind": "~2.1.0", + "@nativescript/webpack": "~5.0.0", + "babel": "^6.23.0", + "babel-loader": "^9.1.3", + "babel-preset-solid": "^1.8.8", + "solid-refresh": "^0.7.5", + "tailwindcss": "~3.4.3" + } + } + \ No newline at end of file diff --git a/src/app.css b/src/app.css new file mode 100644 index 0000000..ef01ac1 --- /dev/null +++ b/src/app.css @@ -0,0 +1,8 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +.h-center { + /* {N} specific css */ + horizontal-align: center; +} diff --git a/src/app.js b/src/app.js new file mode 100644 index 0000000..e1ecbdc --- /dev/null +++ b/src/app.js @@ -0,0 +1,11 @@ +import { Application } from '@nativescript/core'; +import { render } from '@nativescript-community/solid-js'; + +import { App } from './app.jsx'; + +document.body.actionBarHidden = false; +render(App, document.body); + +const create = () => document; + +Application.run({ create }); diff --git a/src/app.jsx b/src/app.jsx new file mode 100644 index 0000000..2ac7f15 --- /dev/null +++ b/src/app.jsx @@ -0,0 +1,34 @@ +import { createSignal } from 'solid-js'; +import { Component } from './component.jsx'; + +document.body.actionBarHidden = false; + +const App = () => { + const [count, setCount] = createSignal(0); + const increment = () => { + setCount((c) => c + 1); + }; + return ( + <> + + + + { + // use 'on:___' instead of 'on___' for event handlers + // See https://github.com/SudoMaker/dominative-solid#event-handling for detail + } + + + + + ); +}; + +export { App }; diff --git a/src/component.jsx b/src/component.jsx new file mode 100644 index 0000000..a943950 --- /dev/null +++ b/src/component.jsx @@ -0,0 +1,13 @@ +export const Component = (props) => { + const { count } = props; + return ( +