Broader Frontends
Author : Kazuhiro Hara
Article permalink

It may be useful to archive the initial output of create-* tools

This is about past versions of frameworks like Next.js and Remix that create new projects with create-* commands.

I have encountered cases where I was using an old version of a framework and wanted to try upgrading from that old version's initial state, or where I wanted a plain state for verification.

It can take effort to reproduce the project creation state from when an old version was current. For example, there is a discussion like this on GitHub.

One reason it becomes difficult to reproduce the state from when that version was current is that the template used by the generation script itself changes.

If you specify an old version when running the create command and the old version of the framework is installed, but the generated code has the latest structure, this is usually the cause.

So what should you do?

For frameworks that I plan to use seriously, I archive the plain generated project state from that time on GitHub. For example, I put it on GitHub with a prefix like archive-.

This is especially useful for versions just before breaking changes.

That way, package-lock.json also remains as it was at the time, which helps when checking differences in behavior against old versions.

But there are plenty of times when you did not archive anything back then.

In my case, when I generate code for a new framework project, I first commit the freshly generated code as "first commit." If that exists, I can use the commit hash from that time to pull out the generated state.

Next.jsRemix

Share