Module: Ruact

Defined in:
lib/ruact.rb,
lib/ruact/doctor.rb,
lib/ruact/errors.rb,
lib/ruact/flight.rb,
lib/ruact/railtie.rb,
lib/ruact/version.rb,
lib/ruact/controller.rb,
lib/ruact/view_helper.rb,
lib/ruact/serializable.rb,
lib/ruact/configuration.rb,
lib/ruact/flight/request.rb,
lib/ruact/html_converter.rb,
lib/ruact/client_manifest.rb,
lib/ruact/flight/renderer.rb,
lib/ruact/render_pipeline.rb,
lib/ruact/erb_preprocessor.rb,
lib/ruact/flight/serializer.rb,
lib/ruact/component_registry.rb,
lib/ruact/flight/row_emitter.rb,
lib/ruact/flight/react_element.rb,
lib/ruact/erb_preprocessor_hook.rb,
lib/generators/ruact/install/install_generator.rb

Defined Under Namespace

Modules: ComponentRegistry, Controller, ErbPreprocessorHook, Flight, Generators, Serializable, ViewHelper Classes: ClientManifest, Configuration, Doctor, ErbPreprocessor, Error, HtmlConverter, ManifestError, PreprocessorError, Railtie, RenderPipeline, SerializationError

Constant Summary collapse

VERSION =
"0.0.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.manifestObject

Returns the value of attribute manifest.



20
21
22
# File 'lib/ruact.rb', line 20

def manifest
  @manifest
end

.streaming_modeObject

Returns the value of attribute streaming_mode.



20
21
22
# File 'lib/ruact.rb', line 20

def streaming_mode
  @streaming_mode
end

Class Method Details

.configRuact::Configuration

Returns the singleton configuration instance.



44
45
46
# File 'lib/ruact.rb', line 44

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields the configuration object for block-style setup.

Examples:

Ruact.configure do |config|
  config.strict_serialization = true
end

Yields:



37
38
39
# File 'lib/ruact.rb', line 37

def configure
  yield config
end

.vite_plugin_pathString

Returns the absolute path to the Vite plugin bundled inside this gem. Use this in vite.config.js: import ruact from ‘<%= Ruact.vite_plugin_path %>’ Re-run ‘rails generate ruact:install` after gem upgrades to refresh the path.

Returns:

  • (String)

    absolute path to vendor/javascript/vite-plugin-ruact/index.js



27
28
29
# File 'lib/ruact.rb', line 27

def vite_plugin_path
  File.expand_path("../vendor/javascript/vite-plugin-ruact/index.js", __dir__)
end