Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices for extensibility #132

Open
pierluigi opened this issue Sep 26, 2016 · 2 comments
Open

Best practices for extensibility #132

pierluigi opened this issue Sep 26, 2016 · 2 comments

Comments

@pierluigi
Copy link
Member

What's great about Roc is that it promotes composition and extensibility. However I can't really find much about best practices on how to write your own extensions or how to simply extend an existing one.

Say, for example, that my team needs https://github.com/rocjs/roc-package-web-app-react but we'd also like to add Redux Saga and possibly other packages. What's the preferred approach here? I see two options:

  1. simply add dependencies to the package.json alongside "roc-package-web-app-react"
  2. fork the web-app-react extension and add the remaining packages

I'm tempted to go for option 2, but the lack of documentation about creating extensions is a concern.

Any thoughts?

Thanks!

@andreasrs
Copy link
Member

Hey! Thanks for the feedback.

You are right, this documentation is currently pretty neglected and it is something we will work hard to improve going onward. We have a work in progress here https://github.com/rocjs/roc/blob/master/docs/Extensions.md

  1. is probably nice for getting things up and running very quick, or for evaluating something before you want to provide it as something composable (package or plugin). In the particular case of redux-saga i recall that integrating it with the react composition is non-trivial, this is on our todo list I believe - @dlmr ?

  2. you probably dont want to do this. it is better to create an entirely new package that extends roc-pakage-web-app-react, adjusting what you need. Or to create a plugin that adds the enhancements you prefer. Then you use that. Forking is fine with templates, but should be avoided with extensions (to avoid fragmentation).

I think a guide/showing the creation of a new extension by example will be nice. If you have an ideas or inspiration we could use as a format for this, please let us know and we will try to take it into account!

@dlmr
Copy link
Member

dlmr commented Sep 26, 2016

In the particular case of redux-saga i recall that integrating it with the react composition is non-trivial, this is on our todo list I believe - @dlmr ?

I think we best support redux-saga officially in roc-package-web-app-react since as stated it is not all that straight forward and a tight integration here will be beneficial. We have a old branch where we have implemented this as a POC that should be quite straight forward to base this feature on now that we have landed the next branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants