Sha256: 0c901671fc7652e1a42dca987951946c83c141fae1ec48544a1ea2290a77f8b0
Contents?: true
Size: 862 Bytes
Versions: 25
Compression:
Stored size: 862 Bytes
Contents
require 'execjs' require 'react/jsx/processor' require 'react/jsx/template' require 'react/jsx/jsx_transformer' require 'react/jsx/babel_transformer' require 'react/jsx/sprockets_strategy' require 'rails' module React module JSX DEFAULT_TRANSFORMER = BabelTransformer mattr_accessor :transform_options, :transformer_class, :transformer # You can assign `config.react.jsx_transformer_class = ` # to provide your own transformer. It must implement: # - #initialize(options) # - #transform(code) => new code self.transformer_class = DEFAULT_TRANSFORMER # @param code [String] JSX code to transform into JavaScript # @return [String] plain, browser-ready JavaScript code def self.transform(code) self.transformer ||= transformer_class.new(transform_options) self.transformer.transform(code) end end end
Version data entries
25 entries across 25 versions & 1 rubygems