Giter Club home page Giter Club logo

reactive's Introduction

Build Status

Project chat: Gitter chat

This is the reactive top-level repository. It contains the following subprojects:

  • reactive-core: This is the general-purpose FRP library
  • reactive-web: Powerful abstractions for rich web UIs; web framework agnostic
  • reactive-routing: A fully typesafe bidirectional routing library; web framework agnostic
  • reactive-web-lift: Lift-specific bindings for reactive-web and reactive-routing
  • reactive-web-demo: demo, serves as documentation for the above. To run it, enter sbt web_demo/jetty:start web_demo/jetty:join

Acknowledgement

YourKit is providing a free open source license for their full-featured Java Profiler for use with this project. YourKit, LLC makes leading profilers for Java and .NET.

reactive's People

Contributors

dominiquedevriese avatar dylemma avatar lvitaly avatar masseguillaume avatar mergify[bot] avatar miguel-negrao avatar nafg avatar ncreep avatar ryanbw avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactive's Issues

Implement JsEventStream GC

Track ownership of event streams by elements. When removing the element (or its parent), remove the event stream.

Fresh clone does not run?

"reactive" looks great! I tried cloning the repository and running with "sbt jetty-run", and I get the following:

java.lang.IllegalArgumentException: requirement failed: Source file '/home/andreas/Documents/Source/trunk/reactive/reactive-web-demo/src/main/webapp/reactive-web-api' does not exist.

Presumably a file that got missed checking in?

Cheers,

Andreas

Deprecate implicit thread-local currentPage, add implicit Page arguments where lacking

Convenient sometimes, but then surprisingly things don't work, when updates come from outside that page's thread (either server push, or by a user interaction on another page).
More importantly, a lot of methods in reactive call methods that take an implicit Page but don't themselves take one. By (at least temporarily) deprecating currentPage, the compiler will reveal the trail.

Perhaps currentPage doesn't need to be removed, and we can just leave the @deprecated annotation in order to generate compiler warning messages.

Does anyone think that this should bump the version number?

Replace println() for info()

Hi,

Right now reactive web using println in several places, this adds a lot of lines to the sbt console, and makes it harder to see the information I am trying to read (which I filter by using a logger).

Could you replace all println for info() calls (I guess you could extend Logger from lift)?

Thanks

Var signals enhancement

Vars could have a method reflect(other: Var[T]) where T is the same as this signal, in order to link their values to another var?, it need more thinking, but I am trying to write a sbt processor that generates wrapper for swing (remember me from the scala list discussion?), and the thing is that for example, all TextComponents have their text signal, a common need is linking texts, this could be done using map, but the text signals are already there (auto generated for all text components suppose) and though you could use overriding to make text signal derivate form another signal, may times its preferred to build the hierarchy and then configure behaviour (setting up bindings, actions etc). I am not sure if the declarative way is the only way to use signals, but sometimes this leads to recursive declarative types when using

val panel = new Panel {...references OtherPanel...}
val otherPanel = new Panel {references panel...}

This can be eluded transforming the val into an object, but this has others drawbacks, for example I have a lib where implicits kick in to pimp up the components providing them some swing building sintax like:

new BorderPanel {
val label = new Label("Label") north this

val changeTextBtn = new Button(Action("Change label") {
label.text = "Other text"
}) center this
}

Because I am using the syntax val something = new ..., implicits can kick in to provide the north and center method, and then return the Component I am using. If the object syntax were to be used, I would have to do something like:

new BorderPanel {
object label extends Label("Label")
label north this

object changeTextBtn extends Button(Action("Change label") {
   label.text = "Other text"
})
changeTextBtn center this

}

Which somewhat kill the idea. So in order to elude the cyclic definition problem, sometimes bindings are deferred (and also to keep code clean). Thats why I would need to be able to bind Vars without being able to override them. The idea of reflecting another Var is to attach listeners to it (implicit observing provided in the reflect method) to observe changes in the other Var and reflect it in the calling Var.

Maybe my whole idea sucks and my usecase too, also I don't know if this is a good place to suggest this.

Thanks for your time.

PropertyVar : className vs class

Hi,

I'm using a PropertyVar to track down and update the value of a class attribute on a div. It's working fine, but I just wanted to draw your attention on the fact that at construction time, PropertyVar("className")("foo") produces a 'classname' attribute, not 'class', leading to invalid html code.

Thanks,

Grégoire Neuville.

There are some deprecated Lift methods being used

Hi,

If you do sbt clean clean-lib update publish-local you will see some deprecated messages on the console, one of them is:

[warn] /Users/wizard/Desktop/work/src/etools/reactive/reactive-web-demo/src/main/scala/reactive/web/demo/snippet/DemoPane.scala:28: lazy value TemplateFinder in package http is deprecated: Use Templates
[warn] template = TemplateFinder.findAnyTemplate(List("templates-hidden", snippetName.toLowerCase)) openOr xhtml

and also

[warn] /Users/wizard/Desktop/work/src/etools/reactive/reactive-web/src/main/scala/reactive/web/Repeater.scala:29: method fixHtml in trait HtmlFixer is deprecated: Use fixHtmlAndJs or fixHtmlFunc
[warn] ).mkString + "e.innerHTML = " + fixHtml(elem.id, e.child) + ";" + (
[warn]

updateProperty doesn't work for class

If using properties to update the attributes of element, the update doesn't work in case the attribute is named 'class'.
Cause is the javascript function updateProperty.

Fix should be:

if (propertyName == "class")
p.className = value;
else
p[propertyName] = value;

flatMap should pick up Signal subclasses

val v = Var(10)
val flatMapped = v.flatMap(x => Var(x + 10)): Signal[Int])

Note how the type ascription is needed. Make the CanFlatMapSignal implicits smarter.

License missing from files

Hi,

None of the scala files (at least in the reactive web subproject) have any license notice, is reactive under Apache2, the same one that Lift uses?

Thanks

CanForwardJs for DomProperty

This would make it easy to, e.g., have an event cause a property to change, without requiring an ajax call to the server.
For instance:

keyUp.jsEventStream.map(_ => ???) ~>> className

Missing Param Type...

Trying to demo reative with a small swing app but having some trouble....

scala> :cp reactive-core_2.8.1-0.1.jar
Added '/Users/ep/git-repos/3rdparty/scala-reactive/reactive/reactive-core/target/scala_2.8.1/reactive-core_2.8.1-0.1.jar'. Your new classpath is:
.:/Users/ep/git-repos/3rdparty/scala-reactive/reactive/reactive-core/target/scala_2.8.1/reactive-core_2.8.1-0.1.jar

scala> import scala.swing._
import scala.swing._

scala> import reactive._
import reactive._

scala> object BindApp extends SimpleSwingApplication {
| val name = Var("Bob")
| override def main(args: Array[String]) {
| startup(args)
| Thread.sleep(5000)
| name ()= "Tom"
| Thread.sleep(5000)}
| def top = new MainFrame {
| title = "Bind App"
| contents = new Button {
| text = name.mapString, Signal[String]
| }}}
:21: error: missing parameter type for expanded function ((x$1) => name.mapString, Signal[String])
text = name.mapString, Signal[String]

flatMap example doesn't compile

On Scala 2.9.0.1 and using reactive-core from git, when trying to compile:

val myVar1 = Var(72)
val myVar2 = Var(69)
val myVar3 = Var(false)

val flatMapped = myVar3 flatMap {
  case true  => myVar1
  case false => myVar2
}

it gives error:
could not find implicit value for parameter canFlatMapSignal: reactive.CanFlatMapSignal[reactive.Signal,reactive.Var]

not enough arguments for method flatMap: (implicit canFlatMapSignal: reactive.CanFlatMapSignal[reactive.Signal,reactive.Var])reactive.Var[Int]. Unspecified value parameter canFlatMapSignal.

Unable to build using 0.0.1-SNAPSHOT

reactive uses the lift version 2.4-SNAPSHOT , which does not appear to exist in any repository that my sbt tries to query. How do you guys manage it?

Select.selectedIndex sends two updates

Hi,

If you go to the demo site here:
http://reactive-web.tk/html/Select
click on the "live demo" button at the bottom of the page.

Open Firebug, and go to the Net tab

Then select Linux from the OS list, after a few seconds you will see a
few request being made, click on the POST request that is about 393B
in size, and you will notice that some of the javascript that is
executed is duplicated,

for example, I see:
try{document.getElementById('vowel').selectedIndex=0}catch(e){}
try{document.getElementById('vowel').selectedIndex=0}catch(e){}

Thanks

Diego

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.