class SvelteOnRails::Lib::ViewHelperSupport

def initialize(file, args, request, caching = false)

def initialize(file, args, request, caching = false)
  @start_time = Time.now
  @conf = SvelteOnRails::Configuration.instance
  utils = SvelteOnRails::Lib::Utils
  utils.validate_filename(file) if @conf.watch_changes?
  @filename = (file.match(/\.svelte$/) ? file[0..-8] : file)
  @args_checksum = Zlib.crc32(args.to_json).to_s(36)
  @helper_options, @html_options, @svelte_props = split_props(
    args,
    %i[class id style],
    %i[ssr hydrate debug cache_key expires_in]
  )
  @request = request
  @ssr = determine_ssr
  # precompile
  if !Dir.exist?(@conf.ssr_dist_folder) || @conf.watch_changes?
    SvelteOnRails::Lib::Utils.watch_changes_and_precompile
  end
  # caching
  if caching
    raise '[svelte-on-rails] Caching required but Redis is not defined' unless defined?(Redis)
  else
    raise '[svelte-on-rails] :expires_in is not allowed for this helper' if @helper_options.key?(:expires_in)
    raise '[svelte-on-rails] :cache_key is not allowed for this helper' if @helper_options.key?(:cache_key)
    return
  end
  generate_cache_key
end