Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/helloworld/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ android {
keyPassword = "release-key-password"
}
}

val devServerHost = project.findProperty("DEV_SERVER_HOST") as String? ?: "10.0.2.2"
buildTypes {
debug {
isDebuggable = true
applicationIdSuffix = ".debug"
buildConfigField("String", "DEV_SERVER_HOST", "\"$devServerHost\"")
}
release {
isMinifyEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class MainActivity : Activity() {

var uri = ""
uri = if (BuildConfig.DEBUG == true) {
"http://10.0.2.2:3000/main.lynx.bundle?fullscreen=true"
val devServerHost = BuildConfig.DEV_SERVER_HOST
"http://$devServerHost:3000/main.lynx.bundle?fullscreen=true"
} else {
"main.lynx.bundle"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/helloworld/apple/HelloWorld/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
rootViewController.view = lynxView

#if DEBUG
// Get dev server host from environment variable or use localhost as fallback
let devServerHost = ProcessInfo.processInfo.environment["DEV_SERVER_HOST"] ?? "localhost"
lynxView.loadTemplate(
fromURL: "http://localhost:3000/main.lynx.bundle?fullscreen=true",
fromURL: "http://\(devServerHost):3000/main.lynx.bundle?fullscreen=true",
initData: nil
)
#else
Expand Down
80 changes: 41 additions & 39 deletions packages/helloworld/package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
{
"name": "HelloWorld",
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "rspeedy build",
"dev": "rspeedy dev",
"format": "prettier --write .",
"lint": "eslint .",
"preview": "rspeedy preview",
"test": "vitest run"
},
"dependencies": {
"@lynx-js/react": "^0.112.5"
},
"devDependencies": {
"@eslint/js": "^9.32.0",
"@lynx-js/preact-devtools": "^5.0.1-6664329",
"@lynx-js/qrcode-rsbuild-plugin": "^0.4.1",
"@lynx-js/react-rsbuild-plugin": "^0.10.13",
"@lynx-js/rspeedy": "^0.11.0",
"@lynx-js/types": "3.4.11",
"@rsbuild/plugin-type-check": "1.2.4",
"@testing-library/jest-dom": "^6.8.0",
"@types/react": "^18.3.23",
"eslint": "^9.32.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"jsdom": "^26.1.0",
"prettier": "^3.6.2",
"typescript": "~5.9.2",
"typescript-eslint": "^8.38.0",
"vitest": "^3.2.4"
},
"engines": {
"node": ">=18"
},
"private": true
}
"name": "HelloWorld",
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "rspeedy build",
"dev": "rspeedy dev",
"format": "prettier --write .",
"lint": "eslint .",
"preview": "rspeedy preview",
"test": "vitest run",
"install:android": "./scripts/android.sh",
"install:ios": "./scripts/ios.sh"
},
"dependencies": {
"@lynx-js/react": "^0.112.5"
},
"devDependencies": {
"@eslint/js": "^9.32.0",
"@lynx-js/preact-devtools": "^5.0.1-6664329",
"@lynx-js/qrcode-rsbuild-plugin": "^0.4.1",
"@lynx-js/react-rsbuild-plugin": "^0.10.13",
"@lynx-js/rspeedy": "^0.11.0",
"@lynx-js/types": "3.4.11",
"@rsbuild/plugin-type-check": "1.2.4",
"@testing-library/jest-dom": "^6.8.0",
"@types/react": "^18.3.23",
"eslint": "^9.32.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"jsdom": "^26.1.0",
"prettier": "^3.6.2",
"typescript": "~5.9.2",
"typescript-eslint": "^8.38.0",
"vitest": "^3.2.4"
},
"engines": {
"node": ">=18"
},
"private": true
}
Loading