FuelLabs / fuels-ts

Fuel Network Typescript SDK
https://docs.fuel.network/docs/fuels-ts/
Apache License 2.0
44.04k stars 1.36k forks source link

Add support for multiple templates in `create fuels` #2837

Closed arboleya closed 3 months ago

arboleya commented 4 months ago

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:

maschad commented 4 months ago

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.

arboleya commented 4 months ago

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.

salemalem commented 1 month ago

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

petertonysmith94 commented 1 month ago

@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.