refactor: add @expo/dev-server#1845
Conversation
bddf261 to
6b73b35
Compare
| ); | ||
| } | ||
|
|
||
| type ConsoleLogLevel = 'info' | 'warn' | 'error' | 'debug'; |
5f70eec to
a6bd7e8
Compare
b6fe237 to
55fbadb
Compare
494ec4a to
d7ea99f
Compare
9e05f00 to
23f102d
Compare
| watchFolders: [...metroConfig.watchFolders], | ||
| }); | ||
| middleware.use(bodyParser.json()); | ||
| middleware.use('/logs', clientLogsMiddleware(options.logger)); |
There was a problem hiding this comment.
Maybe add comments here explaining what these middleware features do
| } | ||
|
|
||
| function handleDeviceLogs(logger: Log, deviceId: string, deviceName: string, logs: any) { | ||
| for (let i = 0; i < logs.length; i++) { |
There was a problem hiding this comment.
| for (let i = 0; i < logs.length; i++) { | |
| for (const log of logs) { |
| @@ -0,0 +1,8 @@ | |||
| { | |||
| "extends": "@expo/babel-preset-cli/tsconfig.base", | |||
| "include": ["src/**/*.ts"], | |||
There was a problem hiding this comment.
Be sure to exclude tests:
{
"extends": "@expo/babel-preset-cli/tsconfig.base",
"compilerOptions": {
"outDir": "build",
"rootDir": "src"
},
"include": ["src/**/*.ts"],
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
}There was a problem hiding this comment.
I want __tests__ to be type checked however, as far as I know Jest compiles them with Babel which doesn't do type checking? Maybe we can only ignore them in .npmignore or files when publishing to npm?
| options.maxWorkers = startOptions.maxWorkers; | ||
| } | ||
| if (startOptions.target) { | ||
| options.target = startOptions.target; |
There was a problem hiding this comment.
Thoughts on moving EXPO_TARGET here to keep the dev server package more agnostic?
| } else if (getenv.boolish('EXPO_USE_DEV_SERVER', false)) { | ||
| await startDevServerAsync(projectRoot, options); | ||
| DevSession.startSession(projectRoot, exp, 'native'); |
There was a problem hiding this comment.
IIRC we talked about potentially putting this in another file so we could identify and deprecate the legacy code more easily.
There was a problem hiding this comment.
I'd rather do this as a part of splitting up XDL, I'll start working on it soon.
It had the port number twice
cli-server-api 4.8.0 doesn't include TS declarations
6303af1 to
5d36147
Compare
Co-Authored-By: Evan Bacon <[email protected]>
Co-Authored-By: Evan Bacon <[email protected]>
Co-Authored-By: Evan Bacon <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1845 +/- ##
=======================================
Coverage 45.09% 45.09%
=======================================
Files 120 120
Lines 4924 4924
Branches 1177 1177
=======================================
Hits 2220 2220
Misses 1898 1898
Partials 806 806 |
@expo/dev-serverwill use the newdev-server-apiand@expo/metro-configpackages to set up a Metro dev server compatible with React Native projects. In addition to the React Native development endpoints, it will include additional endpoints e.g. for serving Expo manifests and receiving logs from Expo client.