Sha256: 83a4d9829a28a3dac46fcd4e293cb24ae618edc44e06c3f5792ca5093dbc76ee
Contents?: true
Size: 874 Bytes
Versions: 16
Compression:
Stored size: 874 Bytes
Contents
require 'babel/transpiler' module React module JSX class BabelTransformer DEPRECATED_OPTIONS = [:harmony, :strip_types, :asset_path] DEFAULT_TRANSFORM_OPTIONS = { blacklist: ['spec.functionName', 'validation.react', 'strict'] } def initialize(options) if (options.keys & DEPRECATED_OPTIONS).any? ActiveSupport::Deprecation.warn("Setting config.react.jsx_transform_options for :harmony, :strip_types, and :asset_path keys is now deprecated and has no effect with the default Babel Transformer."+ "Please use new Babel Transformer options :whitelist, :plugin instead.") end @transform_options = DEFAULT_TRANSFORM_OPTIONS.merge(options) end def transform(code) Babel::Transpiler.transform(code, @transform_options)['code'] end end end end
Version data entries
16 entries across 16 versions & 1 rubygems