fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

Add support for multiple templates in `create fuels`

Open arboleya opened this issue 1 year ago • 2 comments

Currently, we have only one template using NextJS.

Before we can add more templates, we need the basic infra to support N templates.

Then we'll be able to:

npm create fuels -- --template nextjs
npm create fuels -- --template <template-name>

The default version should continue working as it is now, using NextJS:

npm create fuels

This issue is just about pluralizing the template options but adds nothing new.

Follow-up issue:

  • https://github.com/FuelLabs/fuels-ts/issues/2838

arboleya avatar Jul 25 '24 16:07 arboleya

Thanks @arboleya for proposing this enhancement to support multiple templates. While I understand the potential benefits, I have some concerns about the long-term implications of maintaining multiple templates, particularly:

  1. Version synchronization: Keeping all templates up-to-date with the latest dependencies, best practices, documentation, comments etc. could become increasingly complex as the number of templates grows. This might lead to some templates falling behind in fuels versions or inconsistencies between templates, at the very least it will be slower to integrate new features across the multiple templates.

  2. Testing complexity: I assume we would write more e2e tests for each template and we'd have to ensure those pass across different environments, this could introduce new types of test failures, at the very least it would slow down the release process and require more CI resources.

  3. Feature parity issues: Maintaining feature parity across all templates can be challenging. We risk having some templates lag behind in capabilities, which could lead to a confusing or inconsistent experience for developers using different templates. E.g. We currently have the create fuels dApp walkthrough in NextJS, would we document this in multiple templates as well?

  4. Potential for unused or abandoned templates: Some templates may fall out of favour over time in usage amongst our developers but still require maintenance, leading to wasted resources. We'd need a clear policy on when and how to deprecate underused templates.

Given these concerns, I suggest we carefully consider whether the benefits of multiple templates outweigh these potential drawbacks. If we do proceed, we should start with a very limited number of well-chosen templates and have a clear strategy for managing these challenges.

The impetus behind #2781 was to provide flexibility to developers by using a less opinionated framework without introducing multiple templates, so I still would prefer to explore alternative ways to give that kind of flexibility at least.

maschad avatar Jul 26 '24 15:07 maschad

These are all valid concerns, which we discussed before starting the create fuels CLI. In fact, these principles are why we still have only one template. They should continue to play their limiting role, ensuring this number grows controllably.

arboleya avatar Jul 26 '24 16:07 arboleya

If issue is solved, why docs still reference this issue? image

salemalem avatar Oct 17 '24 15:10 salemalem

@salemalem This issue has indeed been finished, and this guide is now out of date, so I have created the following issue to migrate that guide.

In the meantime, the following documentation can be used.

petertonysmith94 avatar Oct 21 '24 08:10 petertonysmith94