elm-lang / elm-reactor

Interactive development tool that makes it easy to develop and debug Elm programs.
BSD 3-Clause "New" or "Revised" License
428 stars 63 forks source link

`elm reactor` is basically unusable on a crappy connection because of the external font #195

Closed lydell closed 8 years ago

lydell commented 8 years ago

I really like using elm reactor. It makes it so easy rapidly prototype things!

I also like coding on the train. There, the Internet connection ranges from okayish to awfully slow to none at all. It’s mostly in the “awfully slow” state.

So, what has the Internet connection on trains (in Sweden) to do with elm reactor? Basically, it boils down to this, which elm reactor includes in its served pages:

@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);

Nothing on the page renders before that request is done. So each time I refresh a page served by elm reactor I stare at a blank page for several minutes, only accompanied by this little tooltip in the browser’s bottom left corner:

connecting-to-fonts

Usually, I just give up and run elm make src/Main.elm && open index.html instead.

Here are are a few alternatives:

process-bot commented 8 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

lydell commented 8 years ago

@process-bot Here’s some extra info you asked for :)

OS: Ubuntu 16.04 Browser: Firefox Developer Edition 49.0a2 Elm: 0.17.0

Steps:

  1. Run elm reactor.
  2. Visit http://localhost:8000 in a browser.
  3. Click an .elm file on a crappy connection.
evancz commented 8 years ago

Thanks for the report, that's pretty lame! I did not know that @import worked like that. I can switch to using a <link> to load that info in and do it at the bottom of the page. There should be a 0.17.1 patch coming out relatively soon, so I'll make sure to get it in there!

lydell commented 8 years ago

Thanks for the update!

Your fix does seem to work on "directory listing" pages, but not on elm file pages:

$ elm reactor &
elm-reactor 0.17.1
Listening on http://localhost:8000/
$ curl -s http://localhost:8000/ | grep -o @import
$ curl -s http://localhost:8000/ | grep -o link
link
$ curl -s http://localhost:8000/src/Main.elm | grep link
$ curl -s http://localhost:8000/src/Main.elm | grep -o @import
@import

Note: