New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace "elm" by "localRuntime" in JS files #124

Merged
merged 2 commits into from Jan 21, 2015

Conversation

Projects
None yet
2 participants
@jvoigtlaender
Contributor

jvoigtlaender commented Jan 21, 2015

No description provided.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 21, 2015

Contributor

Like this?

Contributor

jvoigtlaender commented Jan 21, 2015

Like this?

@evancz evancz merged commit 9c733a1 into elm:master Jan 21, 2015

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 21, 2015

Member

Yeah, added some comments on the merge though.

Some modules do this trick where values get attached to Elm instead of just localRuntime. I generally think this is not a great idea, and I'm not sure of the benefits really. I'd be curious if there's some decisive way to know the right thing on that.

Member

evancz commented Jan 21, 2015

Yeah, added some comments on the merge though.

Some modules do this trick where values get attached to Elm instead of just localRuntime. I generally think this is not a great idea, and I'm not sure of the benefits really. I'd be curious if there's some decisive way to know the right thing on that.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 21, 2015

Contributor

Concerning the latter point, I have no idea when to prefer attaching values to Elm. Is the default attaching them to localRuntime, and whenever the alternative is better in your judgement, you will do it yourself?

Contributor

jvoigtlaender commented Jan 21, 2015

Concerning the latter point, I have no idea when to prefer attaching values to Elm. Is the default attaching them to localRuntime, and whenever the alternative is better in your judgement, you will do it yourself?

@jvoigtlaender jvoigtlaender deleted the jvoigtlaender:localRuntime branch Jan 22, 2015

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jan 22, 2015

Member

When a module needs to call setTimeout or notify or attach event listeners, then it definitely needs to use localRuntime. You don't want to be able to accidentally notify different Elm modules in crazy ways.

When the module is stateless, it can be attached to Elm in theory. That should work for stuff like Array and List, but I have been bitten before by a module that used a guid in some indirect and surprising way that led to bugs. So it works, but it can lead to crazy bugs. Overall, it's not clear that this is a worthwhile thing to ever do.

Member

evancz commented Jan 22, 2015

When a module needs to call setTimeout or notify or attach event listeners, then it definitely needs to use localRuntime. You don't want to be able to accidentally notify different Elm modules in crazy ways.

When the module is stateless, it can be attached to Elm in theory. That should work for stuff like Array and List, but I have been bitten before by a module that used a guid in some indirect and surprising way that led to bugs. So it works, but it can lead to crazy bugs. Overall, it's not clear that this is a worthwhile thing to ever do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment