What do you think of OpalRB? And for Discourse?

(AstonJ) #1

Continuing the discussion from Is it better for Discourse to use JavaScript or CoffeeScript?:


In general, and in relation to the above. Could OpalRB be an option for DC? I saw some tweets wondering if EmberJS would adopt it, and of course Opal has its own framework Vienna (tho I guess it’s too late in the game to switch to that).

I also read somewhere here that Ruby commits to DC far outweigh those of JS, which makes me wonder if adopting OpalRB could prove even more beneficial…

(Robin Ward) #2

I don’t think it’s a great idea. Even when you transpile code you have to know Javascript to debug it properly. So our requirements would still be Ruby and Javascript.

Plus, we are heading down the road of using advanced Javascript features (so far ES6 modules.) Eventually we want to adopt the other awesome stuff in Javascript that makes it much more productive as a language.

I’m not sure if it’s still true that Ruby commits outweigh Javascript. I’d have to look at our code, but we certainly get a lot more Javascript/Ember than we used to. Ember was quite green when we started and not many people knew how to use it.

(AstonJ) #3

That’s a shame : -( I really like the idea of having to do away with JS as much as possible.

I guess the plus side is that it being ‘Ruby’, you get to use JS in ways that you wouldn’t otherwise - there was a good talk about this recently, I will see if I can find it… found it: Ruby Conf 2013 - Opal, A new hope (for Ruby programmers)

(AstonJ) #4

What about using Opal Handlebars for the theming side of things? GitHub - adambeynon/opal-handlebars

Currently it seems the only way to make any changes to the markup is via the Handlebars templates. Most forums have pretty extensive theming options in the ACP, and I think using Ruby for this will make it much easier for designers.

Or are there any other plans to make creating skins easier?

(Zane Beckman) #5

Theming is one area where Opal might have a niche within Discourse. (based on my very limited knowledge, so far, of what Opal can accomplish)

Anywhere else, and I see a lot of possibility of it clashing with ember. In essence… Discourse still has to operate within the framework given by ember, and translating that through Opal does not provide adequate benefit to outweigh the inevitable headache.

This sounds like something that should be taken up by a fork of Discourse as an experiment, and merged back into the core only if the experiment succeeds. The core team certainly has enough on their hands right now.

(AstonJ) #6

After having looked into it further, I agree - handlebars seems to be so tightly integrated with ember, that whatever we use would have to compile to handlebars (which makes opal-handlebars really interesting).

So many benefits to making things easier for designers - really nice custom designed DC installs will undoubtedly be one of its biggest potential assets.

(Zane Beckman) #7

There may be potential for an “opal-ember” project that makes ember more accessible to opal, but that would be outside of the scope of Discourse itself.

I’d be very interested in seeing Opal integrated into specialized areas of Discourse (such as theming), as an experiment. The goal would be to make these areas more accessible to contributors, thus driving contributions. This is in contrast with the rest of Discourse, which uses the complexity of the code as a barrier. Only programmers skilled enough to understand the frameworks being used are able to contribute, reducing feature bloat and increasing the quality of the resulting project. (Whether this was deliberate on their part or just happenstance, I don’t know.) Theming is one area where I’d like to see these barriers minimized.

Another reason why theming lends itself for this is because it’s something that’s currently lacking in Discourse. Limited customization is possible, but in the end, every Discourse forum looks alike. I’ve seen a few in the wild, and it takes a good 10 seconds tops to identify a forum as being a Discourse forum.

I’ve repeated myself a bit, but I think I’ve added some clarity.