Kinto / elm-kinto

An Elm client for the Kinto API
http://package.elm-lang.org/packages/Kinto/elm-kinto/latest
Other
28 stars 7 forks source link

Fix #4: Load bootstrap stylesheet in reactor. #5

Closed n1k0 closed 8 years ago

n1k0 commented 8 years ago

Refs #4. This allows working with reactor and loading the bootstrap stylesheet through the use of a dedicated development HTML file.

Also added support for elm-live, though couldn't figure out how to specify a custom file path to the custom HTML file used (it must be at the root of the repo, which isn't nice).

New docs:

Setup

Node and Elm v0.17 should be installed on your system. Then:

$ npm install

Development server

$ npm start

Then open localhost:8000/html/dev.html.

Live server

This will recompile and reload your app in the browser evertyme you update a .elm file. App is available at localhost:8000/.

$ npm run live

Deploying to gh-pages

$ npm run publish-to-gh-pages

Then result is visible here.

Tests

$ npm test
magopian commented 8 years ago

Will npm start be removed when we find how to load the stylesheets with elm-live? Question being: is there any advantages of using elm-reactor over elm-live?

n1k0 commented 8 years ago

Question being: is there any advantages of using elm-reactor over elm-live?

Debug messages mostly; elm-live has no plan to support them. And I don't much like the mandatory root index.html file if you want a custom one, but that may just be the OCD in me.

magopian commented 8 years ago

I could be wrong but: 1/ debug messages are displayed in the browser console right? At least that's where I've been finding them ;) 2/ it seems elm-live has a dir-path option, maybe that would help having the index.html somewhere else, like in static/ or something? 3/ I've been thinking about having a different index.html for dev and prod: in the dev one, you'd have a flag that tells the Main.elm that it's in debug, and that would display the model content at the bottom of the page (that's what I have locally, so useful for debugging!) I can give it a try if you want, once we land this

magopian commented 8 years ago

oh, I misunderstood what you meant by "debug messages". Indeed there's no way to have them with elm-live in the browser itself. You were talking about compiler messages, and I was talking about Debug.log messages ;) Sorry for the confusion!

n1k0 commented 8 years ago

Yeah, compiler messages. Basically when suddenly your code doesn't compile anymore, the server still runs and you have zero notification that your page is actually broken and not reloaded anymore (meaning you have to always have a term with the server logs at hands to be aware of it).

Maybe I'm just spoiled with the way react hot-reload usually works, but once you tasted it...

Also, I was wondering, if the live server knows about compiler errors, and the server has a way to communicate and inject things into the served webpage environment, how hard would be to work on propagating them visually there?

n1k0 commented 8 years ago

it seems elm-live has a dir-path option

Bah, missed that one.

n1k0 commented 8 years ago

Fixed a few issues with elm-live in https://github.com/n1k0/kinto-elm-experiments/pull/5/commits/b7ed2b3bf517b28024e94886fb4e7381e11674dd, so it loads the stylesheet, and the index.html file is in its own html/live subdirectory.