remoteinterview / zero

Zero is a web server to simplify web development.

Home Page:https://zeroserver.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slow performance with single file example

shedali opened this issue · comments

Just tried with teeny jsx file and found long recompile time - I'm assuming 20 seconds or so is slower than normal to recompile and reload.

https://www.youtube.com/watch?v=mKscgIg9lNM

// index.jsx
import React from 'react'
export default ()=><div>hello world</div>

i'm just starting with zero but i think that might be related to this issue. running yarn install every time might be the reason.

#68

Hello, would you mind trying the latest beta npm install -g zero@beta. I found a few bugs in HMR that might be the reason for this.

I am looking to add tests for HMR soon which should make things more reliable.

error with zero beta

(node:1721) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of undefined
    at /Users/shedali/.config/yarn/global/node_modules/zero/lib/router/matchPath.js:106:63
    at Array.forEach (<anonymous>)
    at getPreferredPath (/Users/shedali/.config/yarn/global/node_modules/zero/lib/router/matchPath.js:104:13)
    at matchPathWithDictionary (/Users/shedali/.config/yarn/global/node_modules/zero/lib/router/matchPath.js:57:14)
    at /Users/shedali/.config/yarn/global/node_modules/zero/lib/router/index.js:263:24
    at Layer.handle [as handle_request] (/Users/shedali/.config/yarn/global/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/shedali/.config/yarn/global/node_modules/express/lib/router/route.js:137:13)

yarn 1.17.3
node 18.8.1

tested zero 1.0.18-alpha.7 and zero 1.0.20-alpha.4

Can you tell me what does your project structure look like and accessing what url/file causes this?

It was an empty directory aside from an index.jsx with contents

import React from 'react'
export default ()=><div>hello world</div>

However, upgraded to Catalina 10.15 Beta (19A536g) and unable to reproduce now 🤔

Interesting. Do share a repro if it ever happens again please. Thanks!