React Lab component

27 views
Skip to first unread message

Piotr Janik

unread,
Feb 9, 2016, 2:46:03 PM2/9/16
to cc-dev...@googlegroups.com
I've created a simple React Lab component while working on GRASP, but decided to extract it to a separate repository, as hopefully it might get useful in the future.

react-lab component repo:
It's published to NPM, but the lib is in UMD format, so can be also included via script tag, RequireJS, etc.

Examples page:
Repository:
I've decided to keep the examples separately, so it's clear what needs to be done to use this lib in a new project. It's pretty much similar to every other NPM module, but you need to make sure that the Lab distribution is available under the same domain. It's provided together with the lib. Examples page uses one line in the webpack config to copy it from node_modules to dist dir. You can use anything else - gulp, bash script or do it manually. 

This wrapper doesn't use iframe-phone, so the communication with Lab is synchronous and it's easy to implement two way property binding (example). It supports set of properties which you can set in a "reactive" way - just set it and forget, you don't need to think when to do it, how to handle model reload and so on. You have an access to scripting API and interactive controller (and even iframe-phone), so you can implement pretty much everything what you could to otherwise. Logging is supported too + I've implemented an optional properties update batching.

It's an experiment, but it works well for GRASP needs. Hopefully it might be useful if we need to create an interactive with very specific, custom widgets. It's easy using model-only view in Lab (example).

Chad Dorsey

unread,
Feb 9, 2016, 3:34:35 PM2/9/16
to cc-dev...@googlegroups.com
This is excellent, Piotr!

—Chad
--
--
----
post message :cc-dev...@googlegroups.com
unsubscribe: cc-developer...@googlegroups.com
more options: http://groups.google.com/group/cc-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Concord Consortium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cc-developer...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Tinker

unread,
Feb 9, 2016, 6:14:40 PM2/9/16
to cc-developers
what is he talking about?
--

Bob Tinker
Founder, the Concord Consortium
rftinker (Skype)


Reply all
Reply to author
Forward
0 new messages