-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal Mode #6270
Minimal Mode #6270
Conversation
Perhaps This approach does have some issues. We would need to have a minimal template for JavaScript as well as TypeScript so we'd be going from 2 templates to 4. Installing the People have also requested the ability to specify custom templates in the past, which we've chosen not to allow. There are some technical reasons, as well as some philosophical ones but maybe it's time to revisit that discussion. |
Removed the @next stuff, happy to implement first class custom templates if you want. |
Also, re: template count, thats a toughie. In the past I've done things like have evaluated templates and file inclusion/exclusion lists, but it makes editing and reading the templates a real pain in the snooch. |
Yeah, I don't think we want to go down that road. We also don't want to maintain a large number of templates. That's why revisiting custom templates might make sense. It's been rejected in the past though. I don't know what the right answer is. I'd like to hear what some of the other maintainers think. |
As someone who maintains a fork of react-scripts so that we can offer a customized template, out of the box dependencies and pre selected options I love the opinionated nature of this template. My problem is that including it out of the box means more out of the box templates that I need to watch with each upgrade when I'd really just love ways to be able to declare side effects in certain key areas of the CRA lifecycle. I know my use-case is outside the current CRA ecosystem but the more templates that are added, the more templates we need to support and patch with each upgrade. CRA is a wonderful tool and templates seem like they offer a good way to deal with file or config differences but don't really allow us to tap into or customize in the init or prepare steps. Not a blocker for this PR but something to think about if more modes/templates like minimal get added. |
Preliminarily speaking, based upon these results, I’d posit that a large group of users are wasting their time deleting stuff: https://twitter.com/ken_wheeler/status/1088567547811766272?s=21 |
Can I guess |
That does seem like a good option. It would be similar to the |
Yep. Let’s make it happen? |
It could but I think that adds a couple issues:
My point here is that create-react-app’s purpose is to provide an easy starting point to create a react app. But when a large, if not majority, number of users spend their first minutes deleting half of it, then it’s not doing the best it can, right? |
We can improve the default template. But this problem came up in many different ways. People want this feature. I don’t think discoverability will be a problem. Someone will make a website with categorised popular ones. Think “boilerplates” but without the build config debt. I’m pretty sure we want this and it will be glorious. |
(For you the only change would be |
Ok, I’ll update it to make template resolve from npm |
I'm excited for you to land your first PR in Create React App. 😂 |
Imagine all you had to do to launch library Foobar examples is to run |
Someone said “In my opinion, Create React App has two main audiences: people new to React who want an easy way to get started and more experienced developers who want to prototype an idea or try something out quickly.” I think there’s a third audience ... experienced developers that build real applications with create-react-app and never eject. That’s what I do. I want the benefit of future enhancements to react-scripts without having to maintain it myself. |
I would like this - been thinking a while about how I like the option selection enabled by Vue-CLI. If you could default to "minimal" if a |
It should also be possible to resolve a template locally. A solution could be to just check if the provided value is a repo url, local path, or, assume it's an npm name as a fallback. That way you could do any of the following:
|
So I'm all for custom templates too, in fact I've raised it with the other maintainers a few times - so this is great. I think we need to settle on a convention that makes sense. Personally, I prefer Perhaps we resolve in a similar way to ESLint configs, in that |
The way we resolve |
Agreed, @iansu. We can use NPM/Yarn-style resolution, where prefixing with The major difference I'm suggesting is that we add some standardisation (and make templates easier to find) by using a prefix, that users can omit when installing via We could also adopt the same for scripts at a later date, but that's not for this discussion. |
I agree that we should use a standard prefix. @gaearon suggested |
Agreed @iansu. @kenwheeler, do you need any help on this? I have a lot of time this weekend to take a look... so I would be happy to pick this up, as it's evolved a little since the initial PR. |
If a template system is gonna happen, the |
@iansu a convention would be great but with namespaces or organizational packages like ‘@jimthedev/my-template’ it sorta falls apart doesn’t it? |
@jimthedev agreed. No point in trying to create a template naming convention... especially since I'd imagine many users will create their own templates and reference it locally. |
Hi @jimthedev and @harrysolovay. In fact it can work - you'd just, as with many other tools, use I think many users will publish templates... and this wouldn't stop you from simply referencing any local module. I agree we could deprecate the |
I've given this some more thought, and I think we'll want to require that templates indicate the minimum compatible version of Another thought - should templates be listed as dependencies once used? I can't think of a good use for this, but it would be nice to keep track of which template was used to initialize a project. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Closing this in favour of the more general template approach in #6514. Thanks for kicking this all off in typical Ken Wheeler style. 😀 |
-minimal
flag