New React.js Template

Hi,

has anyone experience to integrate Discourse into a new react.js template instead of ember ?

And would there any issues with Plugins or future updates ?

Discourse is a full-fleged ember app. It communicates with the discourse api which is built with Rails.

The best way to do what you want to do is generate an api key and fire your requests from your custom frontend to the discourse api.

3 Likes

Thank you.

So when i do this with an API that sounds it would be also possible to extend per example the User Profil right ?

recreate rather than extend in terms of UI which might be unnecessary in most cases.

Just to add …

The API is apparently very stable so use that approach. But don’t expect to use any plugins which modify the interface. Plugins almost always assume you are using and tightly integrate with the Ember app (e.g. Component overrides), so forget those.

Alternatively just use Discourse as is! Learn EmberJS and the plugin system for Discourse if you need to modify the L&F radically beyond Theming.

4 Likes

As we all see that React.js is much more popular than Ember.js, are there any plans to migrate Ember.js to React.js in discourse so that we have a better developer experience?

No there are no plans to rewrite Discourse in react.

6 Likes

And why not better raise Ember’s prestige and popularity? :wink:

Discourse is the greatest living proof that it is a very good framework

1 Like

Hi Alexander, React.js has been selected by developers for many reasons, from the design, docs, community, and ecosystem.

I have been a Web developer since 2012, I experienced the ages when different front-end libraries and tools came out every day. I used jQuery a lot, then backbone, and many self-made libraries. Then I changed to React in 2015, and it’s worked very well for the past seven years. Ember.js was popular, but I must say, nowadays, most developers are using React.js, Vue.js, and Angular.js.

Discourse is working well to date, but after checking the plugin system and searching for the development documents (I’m planning to enrich the Web3 features Contribute Web3 features to Discourse? - General - LXDAO), it feels a little bit hard to build some features immediately for me, a developer with the most common full-stack skills.

I also found the same complaints from China developer communities (probably this is why Discourse isn’t popular in China as WordPress is). So I’m just wondering if we can make Discourse works better if we have a better and updated tech stack.

Don’t get me wrong, I fully understand it’s not an easy and small decision to make, so just post a question here. If we have a plan will see what I can do, if there are no plans, will start learning Ember.js lol

2 Likes

Nothing to do with the fact that Wordpress dates back to 2003 and Discourse only 2014 then? :thinking: Also Wordpress is arguably more general purpose whilst Discourse has a more targeted purpose as mostly a forum platform.

Based on that logic, why don’t we move the back-end to PHP whilst we are at it? I trust you will be providing all the PRs? :wink:

I agree with most of your points. But I think a rewrite is almost never a good idea.
I am writing a react frontend for discourse, but I dont intend it to be a replacement for the ember frontend.
It is more an addition for a very specific use case instead of a reiteration of the same thing. The reason is that I want to make the UI more adaptable to web3 experiments. For this it is more fitting to have an alternative frontend. I recon the custom wizard plugin also goes the route of a separate ember frontend. ( because the functionality is … well … custom :sweat_smile: … so it is reasonable to do it like this )

I have one repo where I have the react frontend with vite:

and then I have a second repo where I pull in the build outputs of the first one in the public assets folder of a discourse plugin.

I also registered in your forum. If you have any questions let me know :grinning: :+1:

3 Likes

Hi dude, as we all know, one of the common reasons for WordPress’s popularity is the highly customizable themes and plugins. There is soo many outsourcing companies or teams that build websites on WordPress for their customer. I also saw some themes or plugins make the WordPress looks like a forum, they should use Discourse to build a forum right? This is the point I want to express.

Anyway, I also admit this sentence, “probably this is why Discourse isn’t popular in China as WordPress is” isn’t very fair. You are right. Sorry for that.

3 Likes