Shadow-cljs: support a command for creating template for react-native app

Created on 5 Mar 2019  路  7Comments  路  Source: thheller/shadow-cljs

Hi,
Now, when write a app with cljs and compile with shadow-cljs, i need to copy files from https://github.com/thheller/reagent-react-native , can shadow-cljs support a command to create a template like re-natal, so it'll be easily for develop react-native app with cljs and shadow-cljs

help wanted

Most helpful comment

... many people like me do not know how to integrate shadow-cljs with others like react-native or ant design

I don't think that templates are good solution to that problem. Better and more docs solve that problem. react-native in particular is not documented well enough (because its relatively new). antd doesn't require any documentation since it is literally npm install antd and then works like any other JS library.

I don't use a whole lot of templates and every single one I have used generated more files than I needed that I end up deleting. So instead of creating 3 files manually I end up creating 10 automatically and deleting 7. shadow-cljs is optimized for CLJS development and will require a lot less files than a similar project would need using clj + cljs.main (or figwheel.main).

I started writing create-cljs-project as a quick template utility. See the Quick Start as an example. Ideally that should be able to generate some basic example sources/configs as well.

Simply put I don't have enough time to do templates by myself. If someone wants to help out writing templates I'll happily help integrate that.

All 7 comments

Currently there is no built-in template mechanism. I'm still planning one but wasn't too happy with the options so far.

@thheller is there any plan to support template?

Yes.

@thheller i think shadow-cljs now need a template system like lein or re-natal urgently, many people like me do not know how to integrate shadow-cljs with others like react-native or ant design锛宨f there is a template system, it'll save a lot of time.

... many people like me do not know how to integrate shadow-cljs with others like react-native or ant design

I don't think that templates are good solution to that problem. Better and more docs solve that problem. react-native in particular is not documented well enough (because its relatively new). antd doesn't require any documentation since it is literally npm install antd and then works like any other JS library.

I don't use a whole lot of templates and every single one I have used generated more files than I needed that I end up deleting. So instead of creating 3 files manually I end up creating 10 automatically and deleting 7. shadow-cljs is optimized for CLJS development and will require a lot less files than a similar project would need using clj + cljs.main (or figwheel.main).

I started writing create-cljs-project as a quick template utility. See the Quick Start as an example. Ideally that should be able to generate some basic example sources/configs as well.

Simply put I don't have enough time to do templates by myself. If someone wants to help out writing templates I'll happily help integrate that.

you are right, i can create template using create-cljs-project in deed.

In case of react-native you are better off with react-native init and then npm install shadow-cljs + npx shadow-cljs init.

I'll leave this open and see if someone feels the urge to work on templates.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alex-dixon picture alex-dixon  路  5Comments

iku000888 picture iku000888  路  8Comments

dhleong picture dhleong  路  10Comments

lilactown picture lilactown  路  6Comments

loganpowell picture loganpowell  路  9Comments