-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
🚀 Feature
Allowing to use lightning app templates independently from the lightning package.
Motivation
Currently, lightning app templates are part of the lightning package, which has some pros and cons.
Pitch
The proposed solution could be a hybrid, some essential templates should stay as part of the lightning package but other templates could stay outside of the repo.
Templates to be in the lightning repo:
1- app-template
2- component-template
3- pl-app-template or trainer-app-template
All other templates can be located either together in a separate package maybe lightning-apps-templates or each app independently in its own repo so we allow users to do something like
lightning init app <github_url_of_lightning_app_template>
Workflow
1- lightning init app app-template
The app-template is part of the lightning package so the framework will copy the template and initialize it easily.
2- app-my-awesome-template This app template is pretty advanced, it may contain a template to train, serve and monitor a model with dashboards. So it's located in its own repo perhaps: gitub.com/manskx/lighting-awesome-app-template
If this repo is accepted in the lightning gallery, the user can do lightning init app app-my-awesome-template
otherwise lightning init app gitub.com/manskx/lighting-awesome-app-template. The framework clones the compatible version of the template repo and initializes it.
Additional context
pros/cons
Having app templates in the lightning package:
- pros:
- can use the templates to create an app offline without internet
- Having control of the templates at the same place as the framework
- cons:
- Size of the package increases and unnecessary files are included in the package
- Not scalable solution, imagine having 100/1000 app templates in the same lightning package.
- An issue was introduced as the templates were not added to the package: Lightning init [app/pl-app] issues #13745
- Separate app templates from the lightning package:
- pros:
- Scalable solution,
- Allowing users to use community app templates
- Keeping the lightning framework package as focused as possible.
- cons:
- Need to ensure that app templates versions are compatible with different lightning framework versions, which introduces some complexities
- Remote templates cannot be used offline.