Giter Site home page Giter Site logo

riot_js-rails's People

Contributors

bjarosze avatar brauliobo avatar bsedin avatar casao avatar danbee avatar hpaul avatar neilsmind avatar osamutake avatar pascal-huber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

riot_js-rails's Issues

Please release a new version

The rubygem version is quite outdated (just saw it is still using class selector).

Please release and push a new version to rubygems.org.

I can do this if you need help.

node_runner is breaking assets compilation

I get this error while trying to compile assets: ExecJS::ProgramError: Unexpected character '#'.

After checking the source code, I found that in node_runner there is a strange line #{source}. Looks like Ruby interpolation.

How should I fix this issue and start using riotjs?

(function(program, execJS) { execJS(program); })(function(module, exports, console) {
  #{source}
}, function(program) {
  var output, print = function(string) {
    process.stdout.write('' + string);
  };
  try {
    result = program();
    if (typeof result == 'undefined' && result !== null) {
      print('["ok"]');
    } else {
      try {
        print(JSON.stringify(['ok', result]));
      } catch (err) {
        print('["err"]');
      }
    }
  } catch (err) {
    print(JSON.stringify(['err', '' + err]));
  }
});

My Rails app environment settings:

Rails.application.configure do
  config.cache_classes = true
  config.eager_load = true
  config.consider_all_requests_local = false
  config.action_controller.perform_caching = true
  config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
  config.assets.js_compressor = :uglifier
  config.assets.compile = false
  config.assets.digest = true
  config.log_level = :warn
  config.assets.precompile << %r{(^[^_\/]|\/[^_])[^\/]*$}
  config.i18n.fallbacks = true
  config.active_support.deprecation = :notify
  config.log_formatter = ::Logger::Formatter.new
  config.active_record.dump_schema_after_migration = false
  config.active_job.queue_adapter = :sidekiq
end

using HTML element as tag in `riot_component` won't work

This code:

<example-tag>
    <h1>
        { header }
    </h1>

    <script type="text/coffeescript">
        @header = opts.header ? "This is a header text"
    </script>
</example-tag>
# index.html.erb
<%= riot_component(:div, :example_tag, { :header => 'Some header' }) %>

raises an error in the javascript console:

Uncaught TypeError: Cannot read property 'class' of undefined
    at mountTo (riot.self-553c20b….js?body=1:2489)
    at pushTagsTo (riot.self-553c20b….js?body=1:1872)
    at each (riot.self-553c20b….js?body=1:939)
    at pushTagsTo (riot.self-553c20b….js?body=1:1877)
    at Object.mount$1 [as mount] (riot.self-553c20b….js?body=1:1927)
    at Object.mount (riot_rails.self-23d2256….js?body=1:16)
    at HTMLDivElement.<anonymous> (riot_rails.self-23d2256….js?body=1:28)
    at Function.each (jquery.self-bd7ddd3….js?body=1:371)
    at jQuery.fn.init.each (jquery.self-bd7ddd3….js?body=1:138)
    at Object.mountAll (riot_rails.self-23d2256….js?body=1:27)

mountTo @ riot.self-553c20b….js?body=1:2489
pushTagsTo @ riot.self-553c20b….js?body=1:1872
each @ riot.self-553c20b….js?body=1:939
pushTagsTo @ riot.self-553c20b….js?body=1:1877
mount$1 @ riot.self-553c20b….js?body=1:1927
mount @ riot_rails.self-23d2256….js?body=1:16
(anonymous) @ riot_rails.self-23d2256….js?body=1:28
each @ jquery.self-bd7ddd3….js?body=1:371
each @ jquery.self-bd7ddd3….js?body=1:138
mountAll @ riot_rails.self-23d2256….js?body=1:27
(anonymous) @ riot_rails.self-23d2256….js?body=1:35
fire @ jquery.self-bd7ddd3….js?body=1:3233
fireWith @ jquery.self-bd7ddd3….js?body=1:3363
ready @ jquery.self-bd7ddd3….js?body=1:3583
completed @ jquery.self-bd7ddd3….js?body=1:3618

as in

  • riot_js-rails 0.7.0
  • Rails 5.0.1

Error in "source" view:
_shutter_20170222_0001

Server rendering

Just like react-rails, implement an option to riot_component (or maybe make that the default) to fully render the component on the server-side.

Cannot require `tag` files on application.js

Well, I have added the gem to the gemfile, runned bundle and added riot and riot_rails to the application.js (in my case, application.coffee).

Now I am struggling to add the tag I have just created to the application.coffee file. I've added it to the root of my assets/javascripts folder with the name mytag.tag and then required it like #= mytag, but that does not seem to work, event after adding the js.tag extension.

Any help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.