Skip to content

Commit db13d24

Browse files
Try fix e2e
1 parent 6abb5b0 commit db13d24

20 files changed

Lines changed: 198 additions & 159 deletions

File tree

.vscode/launch.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@
2727
"preLaunchTask": "build-frontend"
2828
},
2929
{
30-
"name": "Mobile: Build & Run (Expo)",
31-
"type": "node",
30+
"name": "Mobile: iOS",
31+
"type": "node-terminal",
3232
"request": "launch",
33-
"runtimeExecutable": "npm",
34-
"runtimeArgs": ["run", "ios"],
33+
"command": "npm run ios",
3534
"cwd": "${workspaceFolder}/examples/mobile/rn",
36-
"preLaunchTask": "build-mobile",
37-
"console": "integratedTerminal"
35+
"preLaunchTask": "build-mobile"
36+
},
37+
{
38+
"name": "Mobile: Android",
39+
"type": "node-terminal",
40+
"request": "launch",
41+
"command": "npm run android",
42+
"cwd": "${workspaceFolder}/examples/mobile/rn",
43+
"preLaunchTask": "build-mobile"
3844
},
3945
{
4046
"name": "Mobile: Build Only",

.vscode/tasks.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
{
2727
"label": "build-mobile",
2828
"type": "shell",
29-
"command": "dart",
30-
"args": ["run", "tools/build/build.dart", "mobile"],
29+
"command": "mkdir -p examples/mobile/build && dart run tools/build/build.dart mobile && cd examples/mobile/rn && npm install",
3130
"options": {
3231
"cwd": "${workspaceFolder}",
3332
"env": {

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ Write your entire stack in Dart: React web apps, React Native mobile apps with E
77
```mermaid
88
graph TD
99
B[dart_node_express] --> A[dart_node_core]
10-
C[dart_node_node] --> A
10+
C[dart_node_ws] --> A
1111
D[dart_node_react] --> A
1212
E[dart_node_react_native] --> D
1313
B -.-> F[express npm]
14-
D -.-> G[react npm]
15-
E -.-> H[react-native npm]
14+
C -.-> G[ws npm]
15+
D -.-> H[react npm]
16+
E -.-> I[react-native npm]
1617
```
1718

1819
## Packages
@@ -21,7 +22,7 @@ graph TD
2122
|---------|-------------|---------|
2223
| [dart_node_core](packages/dart_node_core) | Core JS interop utilities | 0.1.0-beta |
2324
| [dart_node_express](packages/dart_node_express) | Express.js bindings | 0.1.0-beta |
24-
| [dart_node_node](packages/dart_node_node) | Node.js API bindings | 0.1.0-beta |
25+
| [dart_node_ws](packages/dart_node_ws) | WebSocket bindings | 0.1.0-beta |
2526
| [dart_node_react](packages/dart_node_react) | React bindings | 0.1.0-beta |
2627
| [dart_node_react_native](packages/dart_node_react_native) | React Native bindings | 0.1.0-beta |
2728

examples/mobile/lib/app.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,22 @@ ReactElement _buildCurrentView({
5353
_ => loginScreen(authEffects: authEffects),
5454
};
5555

56+
@JS('console.log')
57+
external void _consoleLog(JSAny? message);
58+
59+
@JS('console.error')
60+
external void _consoleError(JSAny? message);
61+
5662
/// Register the app with React Native
5763
void registerMobileApp() {
58-
registerApp('main', app());
64+
_consoleLog('=== registerMobileApp() STARTING ==='.toJS);
65+
try {
66+
final appComponent = app();
67+
_consoleLog('=== app() created ==='.toJS);
68+
registerApp('main', appComponent);
69+
_consoleLog('=== registerApp() completed ==='.toJS);
70+
} catch (e) {
71+
_consoleError('=== ERROR in registerMobileApp ==='.toJS);
72+
_consoleError(e.toString().toJS);
73+
}
5974
}

examples/mobile/main.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
import 'dart:js_interop';
2+
13
import 'lib/app.dart';
24

5+
@JS('console.log')
6+
external void consoleLog(JSAny? message);
7+
38
void main() {
9+
consoleLog('=== DART MAIN() STARTING ==='.toJS);
410
registerMobileApp();
11+
consoleLog('=== DART MAIN() COMPLETED ==='.toJS);
512
}

examples/mobile/rn/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
// Load compiled Dart app
2-
require('../build/app.js');
2+
console.log('=== INDEX.JS STARTING ===');
3+
try {
4+
console.log('Loading app.js...');
5+
require('../build/app.js');
6+
console.log('=== APP.JS LOADED ===');
7+
} catch (e) {
8+
console.error('=== ERROR LOADING APP.JS ===', e);
9+
}

examples/mobile/rn/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"prestart": "npx kill-port --port 8083 || true",
77
"preandroid": "npx kill-port --port 8083 || true",
88
"preios": "npx kill-port --port 8083 || true",
9-
"start": "expo start --port 8083",
10-
"android": "expo start --android --port 8083",
11-
"ios": "expo start --ios --port 8083",
9+
"start": "./node_modules/.bin/expo start --port 8083",
10+
"android": "./node_modules/.bin/expo start --android --port 8083",
11+
"ios": "./node_modules/.bin/expo start --ios --port 8083",
1212
"build:dart": "cd .. && dart run ../../tools/build/build.dart mobile"
1313
},
1414
"dependencies": {

packages/dart_node_core/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Write your entire stack in Dart: React web apps, React Native mobile apps with E
99
```mermaid
1010
graph TD
1111
B[dart_node_express] --> A[dart_node_core]
12-
C[dart_node_node] --> A
12+
C[dart_node_ws] --> A
1313
D[dart_node_react] --> A
1414
E[dart_node_react_native] --> D
1515
B -.-> F[express npm]
16-
D -.-> G[react npm]
17-
E -.-> H[react-native npm]
16+
C -.-> G[ws npm]
17+
D -.-> H[react npm]
18+
E -.-> I[react-native npm]
1819
```
1920

2021
Part of the [dart_node](https://github.com/MelbourneDeveloper/dart_node) package family.

packages/dart_node_express/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Write your entire stack in Dart: React web apps, React Native mobile apps with E
99
```mermaid
1010
graph TD
1111
B[dart_node_express] --> A[dart_node_core]
12-
C[dart_node_node] --> A
12+
C[dart_node_ws] --> A
1313
D[dart_node_react] --> A
1414
E[dart_node_react_native] --> D
1515
B -.-> F[express npm]
16-
D -.-> G[react npm]
17-
E -.-> H[react-native npm]
16+
C -.-> G[ws npm]
17+
D -.-> H[react npm]
18+
E -.-> I[react-native npm]
1819
```
1920

2021
Part of the [dart_node](https://github.com/MelbourneDeveloper/dart_node) package family.

packages/dart_node_node/CHANGELOG.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)