公開: 2025年2月11日 01:20:00 JST
Article Header Image

Migration from elm-pages v2 to v3

For details, refer to the official upgrade documentation.

Basically, by following the official document, you should be able to modify your v2 repository to pass the v3 build. However, upgrade scripts are not provided, so manual work is required, and there are many pitfalls.

Dillon-san recommends creating a new repository using the starter repo as a template, ensuring it builds successfully, and then incrementally migrating the Page modules from the v2 repository while ensuring the build passes.

I followed this approach too and will highlight the key changes encountered. Specifically, this guide is intended for those who have built static sites with v2 and want to migrate to v3 while keeping the site static. I believe this need is significant. At the end of the article, I will also touch on the development experience and build performance after migrating to v3.

(記事の日本語版はこちら)

Notable Preliminary Knowledge

Frequently Required Changes

Pruning Features Not Required in Static Site Building

Undocumented Changes (So Far)

Development Experience and Build Performance After Migrating to v3

Unassessed Parts

Conclusion: Should You Upgrade? / Time to Start?

Adding to all of the above, I recommend reading the latest FAQ on elm-pages design to deepen your understanding.

With all that in mind, should you invest the effort to upgrade? My personal evaluation is:

If you don't have a v2 site now and are interested in elm-pages? Now is definitely the time to start.

During the beta period and shortly after the release of elm-pages v3, there were difficulties with setting up the development environment, such as preparation of the Lamdera compiler, but these have been resolved, and you can develop just like a regular Elm project.

If you are not familiar with Elm, it is better to learn the basics of Elm first using the famed Elm Guide or find a mentor. However, if you are already familiar with Elm and want to build static sites in Elm or start full-stack Elm, it is an excellent choice.

Disclosure: The author is a GitHub sponsor of Dillon-san, the creator of elm-pages.

公開: 2025年2月11日 01:20:00 JST