Sha256: 77de1344d1e46f3206f4fe1a4f077ef24320b439adb084f3f3b512083b4967ec

Contents?: true

Size: 538 Bytes

Versions: 1

Compression:

Stored size: 538 Bytes

Contents

module React
  module ServerRendering
    class LiveReloadableRenderer < SprocketsRenderer
      def initialize(options = {})
        @filenames = options.fetch(:files, ["react.js", "components.js"])
        super
      end

      def render(component_name, props, prerender_options)
        js_code = CONSOLE_POLYFILL.dup
        @filenames.each do |filename|
          js_code << ::Rails.application.assets[filename].to_s
        end
        @context = ExecJS.compile(GLOBAL_WRAPPER + js_code)
        super
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
react-rails-livereloadable_renderer-0.0.1 lib/react/server_rendering/livereloadable_renderer.rb