Skip to content
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

fixed broken foreach in 0.5 #117

Closed
wants to merge 10 commits into from
Closed

fixed broken foreach in 0.5 #117

wants to merge 10 commits into from

Conversation

dioptre
Copy link

@dioptre dioptre commented Jan 30, 2016

No description provided.

@dioptre
Copy link
Author

dioptre commented Jan 30, 2016

added your old demo code and created a plugin to share Javascript (JSON) betwen non escher components

@dioptre
Copy link
Author

dioptre commented Jan 30, 2016

reverted update for 0.5 as broke 0.4

@dioptre
Copy link
Author

dioptre commented Jan 30, 2016

Hi @shashi I removed the attempted fix for 0.5 but there's a json webcomponent in the pull request that'd be great to include in the base - i'll be adding another raw component soon too

@shashi
Copy link
Member

shashi commented Jan 31, 2016

Could you tell me how you are using the json-mirror component?

This PR does many things, can you make it do just one, and open more PRs for other things?

@dioptre
Copy link
Author

dioptre commented Feb 24, 2016

hi i simplified it in the next pr

the json acts as a mirror between client and server - which both can bind to - very flexible, and for components not supported by escher or polymer out of the box - ill be using this

@MichaeLeroy
Copy link
Contributor

This PR came to my attention because I ran into the issue of Escher choking on foreach. This occurs because foreach is used in both Reactive and Compat:

mike@harlan:~/carly/home-raw/escher$ escher --serve
Listening on 0.0.0.0:5555...
WARNING: both Reactive and Compat export "foreach"; uses of it in module Main must be qualified

Perhaps I see this error because I've gotten a bit ahead of the stable version of the 0.4 release:

julia> versioninfo()
Julia Version 0.4.6-pre+18
Commit 198644a (2016-04-01 03:37 UTC)
....

Possibly users with an older version have not yet seen this issue.

The conflict suggests that an alternative (to that of @dioptre) fix of the problem with foreach is to qualify it as Reactive.foreach:

mike@harlan:~/.julia/v0.4/Escher/src/cli$ git diff serve.jl
diff --git a/src/cli/serve.jl b/src/cli/serve.jl
index ea9d1a1..19f3745 100755
--- a/src/cli/serve.jl
+++ b/src/cli/serve.jl
@@ -158,7 +158,7 @@ uisocket(dir) = (req) -> begin

     window = Window(dimension=(w*px, h*px))

-    foreach(asset -> write(sock, JSON.json(import_cmd(asset))),
+    Reactive.foreach(asset -> write(sock, JSON.json(import_cmd(asset))),
          window.assets)

     main = loadfile(file)

A better solution might be to request that Reactive make its version of foreach compatible with this addition to the language (JuliaLang/julia#13774). I'm not particularly familiar with Reactive and am not is a strong position to pose this as a Reactive issue. @shashi you seem somewhat plugged into Reactive development, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants