0

I'm building an applications front-end using ReactJS and redux state container. This app (core) is going to be reused in some various projects in some of which I will need some additional features / extensions (plugin). These need to be separated from the core. The app and extensions are rendered on client's browser (I'm not pre-rendering anything on the server).

I'm looking for a way to:
a) create an "thrird party" plugin which can access the core apps state
b) render an "thrird party" plugin component from within the core app

Any ideas?
Thanks ;)

romek
  • 615
  • 1
  • 6
  • 13
  • 1
    Your question is a little bit too broad. If you add some come code examples or snippets with what you are trying to achieve it would be easier to answer. – Moti Korets Apr 07 '18 at 07:36

1 Answers1

0

@romek from what I understand is that your use case sounds like a classic case of scaling ( modularity ) your software. What I'd suggest is that having a clear understanding of the parts involved in making a component / container work. These are ( as per my experience ) -

  1. Reading data from the store ( selectors ).
  2. Writing data to the store ( reducers ).
  3. Handing other side-effects / interactions ( thunk or sagas).
  4. The actual component which consumes these modules.

Now once you've identified all these pieces ( or more ), you make every 3rd party component confer / implement this design. Now you just need to import the component and render it.

Hope this helps!

Shobhit Chittora
  • 1,209
  • 8
  • 13
  • _Now you just need to import the component and render it._ This is actually my biggest problem. I need to keep things separate. I'm not sure if that is possible at all but I don't want to change and re-build the core application for each local instance. However I would like to render a sort of "dynamic" and interactive component inside the apps ui. – romek Apr 07 '18 at 06:43
  • 1
    So you'll have a plugin Container which will render all your 3rd party plugins which comply to your standards. Also you can have a look at render props design pattern. – Shobhit Chittora Apr 08 '18 at 08:17