Sha256: f0b298dfbed31d0356594801fc8eba75f09307e3a4699978845239ce60ab1d67

Contents?: true

Size: 1.17 KB

Versions: 20

Compression:

Stored size: 1.17 KB

Contents

module Isomorfeus
  module Preact
    module Imports
      def self.add
        Isomorfeus.add_web_js_import('preact/debug') if Isomorfeus.development?
        Isomorfeus.add_common_js_import('preact', 'Preact', '*')
        Isomorfeus.add_common_js_import('preact/hooks', 'PreactHooks', '*')
        Isomorfeus.add_common_js_import('wouter-preact', nil, ['Router', 'Link', 'Redirect', 'Route', 'Switch'])

        Isomorfeus.add_ssr_js_import('preact-render-to-string', 'Preact', ['render'], nil, 'renderToString')
        Isomorfeus.add_ssr_js_import('wouter-preact/static-location', 'staticLocationHook')

        Isomorfeus.add_web_js_import('wouter-preact/use-location', 'locationHook')

        if Dir.exist?(Isomorfeus.app_root)
          if File.exist?(File.join(Isomorfeus.app_root, 'isomorfeus_loader.rb'))
            Isomorfeus.add_common_ruby_import('isomorfeus_loader')
            Isomorfeus.add_ssr_ruby_import('isomorfeus/preact/ssr/top_level')
            Isomorfeus.add_ssr_ruby_import('isomorfeus/preact/ssr/render_core')
            Isomorfeus.add_ssr_ruby_import('isomorfeus/preact/ssr/history')
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
isomorfeus-preact-10.9.0 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.8.2 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.8.1 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.8.0 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.7.3 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.7.2 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.7.1 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.7.0 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.62 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.61 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.60 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.59 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.58 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.57 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.56 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.55 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.54 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.53 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.52 lib/isomorfeus/preact/imports.rb
isomorfeus-preact-10.6.51 lib/isomorfeus/preact/imports.rb