Skip to content

Thoughts on "create-react-lib" #1294

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

Closed
2 tasks
cguedes opened this issue Dec 19, 2016 · 6 comments
Closed
2 tasks

Thoughts on "create-react-lib" #1294

cguedes opened this issue Dec 19, 2016 · 6 comments

Comments

@cguedes
Copy link

cguedes commented Dec 19, 2016

Hi

I'm trying to use create-react-app to build a React library, but I'm facing some challenges. Maybe create-react-app is not the best-fit approach for this and "we" should create something like create-react-lib project.

Current challenges:

  • stable generated output/dist lib to put in the package.json/index entry
  • option to, maybe optionally, embeed assets (i.e.: styles)

Maybe this is not suitable for this project. In that case, please point me to relevant projects that address this issues.

/Thanks

@tbillington
Copy link

I had a decent amount of success with https://github.com/insin/nwb. It is very heavy dependency wise but otherwise it works well and produces all kinds of outputs you could wish for, es6, es5, and umd.

@chiefGui
Copy link

chiefGui commented Dec 20, 2016

I'm not sure if @gaearon is aware of this thread, but I think it is somehow correlated to #1107 and also quite important to understand the purpose of create-react-app.

I've been creating projects that have the same design language and to avoid technically repeating myself, I came to the most concise solution React brought: modularity. For this reason, I started to build a UI kit. At the very beginning, I got stuck. The reason is simple: my projects, powered by create-react-app, aren't ready to deal with local packages.

I tried some solutions (the one I came up is described here), but none of them were good enough to make me fully productive.

For that reason, and seeing the module @tbillington shared, I figured that create-react-app is not the way to go for libs/components. I mean, it describes itself very well by its name.

I am nobody to say what CRA is or what it is not, but I'd say that your words are precisely correct:

Maybe this is not suitable for this project. In that case, please point me to relevant projects that address this issues.

But I'm here to manifest curiosity towards a create-react-lib and if it wasn't the initial intentions of Facebook when they built the sketches for create-react-app. And only between us: CRA is just great. nwb looks cool too, but the lack of jest to test makes it unusable for me.

@tbillington
Copy link

@chiefGui If jest is the only thing holding you back, insin/nwb#173 😛 .

@gaearon
Copy link
Contributor

gaearon commented Feb 11, 2017

Going to close since we don’t intend to support something like this in near future, but please feel free to use nwb for this, I heard it’s great!

@gaearon gaearon closed this as completed Feb 11, 2017
@cguedes
Copy link
Author

cguedes commented Feb 12, 2017

Ok @gaearon. Thanks for the feedback. Will look into nwb.

@gaearon
Copy link
Contributor

gaearon commented Feb 12, 2017

See also discussion in #1492 and past discussions linked from it.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants