• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zeit / next.js / 8846
53%
master: 52%

Build:
Build:
LAST BUILD BRANCH: canary
DEFAULT BRANCH: master
Ran 17 Dec 2018 11:24AM UTC
Jobs 2
Files 77
Run time 28s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8846

push

travis-ci

timneutkens
Improve dev experience by listening faster (#5902)

As I detailed in [this thread on Spectrum](https://spectrum.chat/?t=3df7b1fb-7331-4ca4-af35-d9a8b1cacb2c), the dev experience would be a lot nicer if the server started listening as soon as possible, before the slow initialization steps. That way, instead of manually polling the dev URL until the server's up (this can take a long time!), I can open it right away and the responses will be delivered when the dev server is done initializing.

This makes a few changes to the dev server:

* Move `HotReloader` creation to `prepare`. Ideally, more things (from the non-dev `Server`) would be moved to a later point as well, because creating `next({ ... })` is quite slow.
* In `run`, wait for a promise to resolve before doing anything. This promise automatically gets resolved whenever `prepare` finishes successfully.

And the `next dev` and `next start` scripts:

* Since we want to log that the server is ready/listening before the intensive build process kicks off, we return the app instance from `startServer` and the scripts call `app.prepare()`.

This should all be backwards compatible, including with all existing custom server recommendations that essentially say `app.prepare().then(listen)`. But now, we could make an even better recommendation: start listening right away, then call `app.prepare()` in the `listen` callback. Users would be free to make that change and get better DX.

Try it and I doubt you'll want to go back to the old way. :)

1939 of 11009 branches covered (17.61%)

5759 of 10457 relevant lines covered (55.07%)

8.14 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8846.1 17 Dec 2018 11:24AM UTC 0
55.07
Travis Job 8846.1
2 8846.2 17 Dec 2018 11:24AM UTC 0
55.07
Travis Job 8846.2
Source Files on build 8846
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8846
  • b91a9601 on github
  • Prev Build on canary (#8842)
  • Next Build on canary (#8848)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc