Sha256: 9fe82aa578c72e0eea9e02e7d7aad86271383d4dce7ea38073ca61afd4b36ef8

Contents?: true

Size: 799 Bytes

Versions: 56

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

require "connection_pool"
require_relative "server_rendering_pool/ruby_embedded_java_script"

# Based on the react-rails gem.
# None of these methods should be called directly.
module ReactOnRails
  module ServerRenderingPool
    class << self
      def pool
        @pool ||= if ReactOnRails::Utils.react_on_rails_pro?
                    ReactOnRailsPro::ServerRenderingPool::ProRendering
                  else
                    ReactOnRails::ServerRenderingPool::RubyEmbeddedJavaScript
                  end
      end

      delegate :reset_pool_if_server_bundle_was_modified, :reset_pool, to: :pool

      def server_render_js_with_console_logging(js_code, render_options)
        pool.exec_server_render_js(js_code, render_options)
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
react_on_rails-15.0.0.alpha.1 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-14.0.5 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-14.0.4 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-14.0.3 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-14.0.2 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-14.0.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.4.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.3.5 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.3.4 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.3.3 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.3.2 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.3.1 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.3.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.2.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.1.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.0.2 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.0.1 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.0.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-13.0.0.beta.0 lib/react_on_rails/server_rendering_pool.rb
react_on_rails-12.6.0 lib/react_on_rails/server_rendering_pool.rb