Skip to content
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

Add minimal template #54

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add minimal template #54

wants to merge 6 commits into from

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Jan 6, 2025

This is a slimmed down "minimal" template for create-react-router intended not as a production ready solution but a way to easily play with the framework, experiment, create demos, etc.

For now, this can be invoked via the --template flag but I think we may consider making it the default as well. My hunch is that the majority of create-react-router executions don't actually result in a production app or a deployment beyond localhost. Users who want that extra complexity can opt into it via --template.

This starts with the default template and removes the following:

  • styling (tailwind, postcss, autoprefixer, app.css)
  • docker setup (3 dockerfiles and dockerignore)
  • <Welcome> component and associated images in favor of a simple home.tsx with a loader and a "Hello World" type component
  • entry.server/entry.client files
    • The first thing I always do when creating a demo is remove these so there's less files to deal with. It is a bit of "magic" through and we've gone back and forth a few times in the past as to whether or not to include them so I don't feel too strongly about keeping them out

minimal/package.json Outdated Show resolved Hide resolved
}

export default function Home({ loaderData }: Route.ComponentProps) {
return <h1>Hello {loaderData.name}</h1>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to beef this up with a link to the docs or something simple

"scripts": {
"build": "react-router build",
"dev": "react-router dev",
"start": "react-router-serve ./build/server/index.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is not marketed as production ready and the README doesn't even mention build/start I removed the NODE_ENV stuff here and the cross-env dependency. We can add it back in through if folks feel strongly

@brookslybrand
Copy link
Contributor

I definitely like how simple this is, however, as is I don't think this should be the default.

We intentionally revamped our templates to be a little prettier. This would be a step backwards to remove it completely.

I get that having tailwind as a default for some is more config than necessary. I think with v4 coming so soon this will get even less cumbersome, since tw will simply be a Vite plugin.

I also think that for most people, tailwind is a reasonable default if they're just getting started, rapid prototyping, or using the template for teaching. If you remove it it ends up meaning for the majority of people they're going to have an added step of adding it back. Again, I think removing it would be a step backwards if this were the default

I'm all for removing the Dockerfile for the default experience, and saying "if you want to learn how to deploy your app, checkout all these ready to deploy options/read this doc that we have"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants