wied03 / react-opal Goto Github PK
View Code? Open in Web Editor NEWFork of React.Rb Wrapper
License: Other
Fork of React.Rb Wrapper
License: Other
https://www.tildedave.com/2014/11/15/introduction-to-contexts-in-react-js.html
Could make this work w/ React.rb:
#Component factory:
optional_native_alias[:getChildContext, :get_child_context]
# and under ctor.DefaultProps=
ctor.contextTypes = #{klass.respond_to?(:get_context_types) ? klass.get_context_types : `{}`};
ctor.childContextTypes = #{klass.respond_to?(:get_child_context_types) ? klass.get_child_context_types : `{}`};
# Then:
module ReactTweaks
module ChildContext
def self.included(base)
base.class_eval do
class_attribute :context, :child_context
end
base.extend(ClassMethods)
end
def context_from_parent
Hash.new(`#{self}.context`).inject({}) do |memo, (k, v)|
memo[k.underscore] = v
memo
end
end
module ClassMethods
def context_types(&block)
self.context = block.call
end
def child_context_types(&block)
self.child_context = block.call
end
def get_context_types
self.context || `{}`
end
def get_child_context_types
self.child_context || `{}`
end
end
end
end
https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html
React now supports two compiler optimizations that can be enabled in Babel 5.8.24 and newer. Both of these transforms should be enabled only in production (e.g., just before minifying your code) because although they improve runtime performance, they make warning messages more cryptic and skip important checks that happen in development mode, including propTypes.
Might want to change the method_missing
behavior that deals with HTML element and create them this way (1 less function call)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.