Conversation

edited

Edited 1 time

mkonicek edited Feb 27, 2017 (most recent)

This PR allows anyone to publish templates for React Native.

It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:mkonicek/AppTemplateFeedback#1

This comment has been minimized.

Code looks great! Philosophically, I'm wondering if you should keep built in templates. Since a template being built in would be extra overhead and need to be exclusive. You'll have to have a rule-set on who's PRs can be built in and who's not. Regardless of size implications, this puts an interesting onus on the PR-review team.

My suggestion is go 100% npm, with a purely documentation based guide of examples. This feels more OSS and keeps the templates as proper tool for the community.

Also, as a code management initiative, templates being in their own repo and outside the local-cli feels right.

edited

Edited 1 time

GantMan edited Feb 23, 2017 (most recent)

Code looks great! Philosophically, I'm wondering if you should keep built in templates. Since a template being built in would be extra overhead and need to be exclusive. You'll have to have a rule-set on who's PRs can be built in and who's not. Regardless of size implications, this puts an interesting onus on the PR-review team.

My suggestion is go 100% npm, with a purely documentation based guide of examples. This feels more OSS and keeps the templates as proper tool for the community.

Also, as a code management initiative, templates being in their own repo and outside the local-cli feels right.

Summary:
This PR allows anyone to publish templates for React Native.
It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
mkonicek/AppTemplateFeedback#1
I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).
(GitHub: https://github.com/mkonicek/react-native-template-demo)
With this PR anyone can then use that template:
`react-native init MyApp --template demo`
The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.
Use a template called `react-native-template-demo` from npm:
`react-native init MyApp --template demo`
Use a local template:
`react-native init MyApp --template file:///path_to/react-native-template-dem
Closesfacebook#12548
Differential Revision: D4620567
Pulled By: mkonicek
fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a

Summary:
This PR allows anyone to publish templates for React Native.
It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
mkonicek/AppTemplateFeedback#1
I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).
(GitHub: https://github.com/mkonicek/react-native-template-demo)
With this PR anyone can then use that template:
`react-native init MyApp --template demo`
The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.
Use a template called `react-native-template-demo` from npm:
`react-native init MyApp --template demo`
Use a local template:
`react-native init MyApp --template file:///path_to/react-native-template-dem
Closesfacebook#12548
Differential Revision: D4620567
Pulled By: mkonicek
fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a

Summary:
This PR allows anyone to publish templates for React Native.
It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
mkonicek/AppTemplateFeedback#1
I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).
(GitHub: https://github.com/mkonicek/react-native-template-demo)
With this PR anyone can then use that template:
`react-native init MyApp --template demo`
The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.
Use a template called `react-native-template-demo` from npm:
`react-native init MyApp --template demo`
Use a local template:
`react-native init MyApp --template file:///path_to/react-native-template-dem
Closesfacebook#12548
Differential Revision: D4620567
Pulled By: mkonicek
fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a

This comment has been minimized.

@mkonicek Will there be documentation for how to create a template? Are custom native folders such as Android and iOS allowed for template projects. Suppose I want my template to have a custom native Android Activity/iOS ViewController, is that possible, or is only JS related files observed by the template?

@mkonicek Will there be documentation for how to create a template? Are custom native folders such as Android and iOS allowed for template projects. Suppose I want my template to have a custom native Android Activity/iOS ViewController, is that possible, or is only JS related files observed by the template?