Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upIf doc.body is null, throw "move elm.js <script> " #709
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Sep 11, 2016
Thanks for the pull request! 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.
process-bot
commented
Sep 11, 2016
|
Thanks for the pull request! 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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
devinrhode2
Sep 11, 2016
haskell platform was taking a while to install, so I figured I'd just search for and directly edit the js here using githubs online editor. I have not managed to build and run this yet.
devinrhode2
commented
Sep 11, 2016
•
|
haskell platform was taking a while to install, so I figured I'd just search for and directly edit the js here using githubs online editor. I have not managed to build and run this yet. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
devinrhode2
commented
Sep 11, 2016
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Sep 12, 2016
Member
If the document isn't finished loading then Module.embed() is going to throw for the same reason, so handling this will have to be moved one level higher than fullscreen(). I wonder if we could hide this detail from users altogether by wrapping startup with
function startElmProgram()
{
// ...
}
if (document.readyState === 'complete')
{
startElmProgram();
}
else
{
document.addEventListener('DOMContentLoaded', startElmProgram);
}|
If the document isn't finished loading then function startElmProgram()
{
// ...
}
if (document.readyState === 'complete')
{
startElmProgram();
}
else
{
document.addEventListener('DOMContentLoaded', startElmProgram);
} |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
devinrhode2
Sep 12, 2016
No. That's way less robust. Elm should not mess with setting up a
document.ready event here in my opinion. If you really want to do that,
copy out the document.ready our of the latest version of jQuery. I don't
think this code structure would work well with that. There's probably a
handful of other good reasons to put scripts at the bottom.
We should, however, hide this from users by creating a proper index.html
file for users. I copied out of few good but missing tags from embers
index.html, however, there's no compile time hook to add content to the
head tag. (will share some links in a sec)
On 11 Sep 2016 17:59, "Luke Westby" notifications@github.com wrote:
I wonder if we could hide this detail from users by wrapping startup with
function startElmProgram()
{
// ...
}
if (document.readyState === 'complete')
{
startElmProgram();
}else
{
document.addEventListener('DOMContentLoaded', startElmProgram);
}—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/elm-lang/core/pull/709#issuecomment-246217154, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAg8qCahQO7Im9PbiH5jmmi1IbqWkUDSks5qpKPogaJpZM4J6IwM
.
devinrhode2
commented
Sep 12, 2016
•
|
No. That's way less robust. Elm should not mess with setting up a We should, however, hide this from users by creating a proper index.html On 11 Sep 2016 17:59, "Luke Westby" notifications@github.com wrote:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
devinrhode2
Sep 12, 2016
So this is the default index.html template for a new ember app:
https://github.com/rwjblue/--new-app-blueprint/blob/modules/src/ui/index.html
Here's a real world index.html that is filled out more (obviously not all
this is quite as important as the things in the default template):
https://github.com/rwjblue/--ghost-modules-sample/blob/grouped-collections/src/ui/index.html
However... I'm probably incorrect. I think ultimately elm shouldn't be
trying to work with the dom until it's ready. I don't know anything about
this code base and architecture. However, I don't think the whole app
startup should wait for document.ready. It should simply be the rendering
layer. This is why I intuitively and quickly responded negatively to your
suggestion
On 11 Sep 2016 18:26, "devin rhode" devinrhode2@gmail.com wrote:
No. That's way less robust. Elm should not fuck with setting up a
document.ready event here in my opinion. If you really want to do that,
copy out the document.ready our of the latest version of jQuery. I don't
think this code structure would work well with that. There's probably a
handful of other good reasons to put scripts at the bottom.We should, however, hide this from users by creating a proper index.html
file for users. I copied out of few good but missing tags from embers
index.html, however, there's no compile time hook to add content to the
head tag. (will share some links in a sec)On 11 Sep 2016 17:59, "Luke Westby" notifications@github.com wrote:
I wonder if we could hide this detail from users by wrapping startup with
function startElmProgram()
{
// ...
}
if (document.readyState === 'complete')
{
startElmProgram();
}else
{
document.addEventListener('DOMContentLoaded', startElmProgram);
}—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/elm-lang/core/pull/709#issuecomment-246217154, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAg8qCahQO7Im9PbiH5jmmi1IbqWkUDSks5qpKPogaJpZM4J6IwM
.
devinrhode2
commented
Sep 12, 2016
|
So this is the default index.html template for a new ember app: Here's a real world index.html that is filled out more (obviously not all On 11 Sep 2016 18:26, "devin rhode" devinrhode2@gmail.com wrote:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rtfeldman
Sep 12, 2016
Member
No. That's way less robust. Elm should not fuck with
Let's keep it civil. :)
@devinrhode2 I like the general UX idea here, but have you seen this? https://github.com/elm-lang/core/pull/709#issuecomment-246212555
Let's keep it civil. :) @devinrhode2 I like the general UX idea here, but have you seen this? https://github.com/elm-lang/core/pull/709#issuecomment-246212555 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
devinrhode2
commented
Sep 12, 2016
|
Ok let's try this again: https://github.com/elm-lang/core/pull/711 |

devinrhode2 commentedSep 11, 2016
Checkout the last few commits on my project here: https://github.com/devinrhode2/structured-elm-todomvc/tree/emberify2
If you rewind and replay the commits you will see logic behind my error message.