How to make a React.js-based page within Discourse that only re-uses its header and session?

What you’re proposing would have to go through some circus like

  • Call to domain/my-page.html
  • Discourse 404’s
  • Your custom JS catches that 404, recognizes that it came from your custom route somehow, and… renders the whole template into the 404 div?
  • Meanwhile, it also loads a react component, which… I guess gets slid into a particular DOM element using react-dom-inject or something?
  • Then it subscribes to messageBus, err maybe by loading something like let messageBus = Discourse.__container__.lookup('messageBus:main').subscribe? (<-- this code I think still works today, but likely won’t forever, or even for much longer)

I don’t quite get it; why is creating a custom plugin, or using Ember, not an option here?

I get that the plugin architecture and perhaps Ember has a steep learning curve, but this is really using a :hammer: to churn the butter.

4 个赞