mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-23 22:26:16 +03:00
2.1 KiB
2.1 KiB
elm-pages
Upgrade Guide
Upgrading to Elm Package 1.1.0 and NPM Package 1.1.3
Here's a diff to help guide you through the change: 5de5102d70
.
High level changes
- A few modules that were previously copied to the
gen
folder are now part of the published package. This makes it easier to discover the functionality through the package site and understand how to initialize anelm-pages
app. - The new
StaticHttp
API now allows you to make HTTP requests during the build step that are built into your app's assets (see the StaticHttp announcement blog post). If you don't have any StaticHttp data for a given page, you can useStaticHttp.succeed
(see the changes to the view function in the elm-pages-starter diff).
Step by step upgrade checklist
- Be sure to install the latest NPM package and the latest elm package (NPM version 1.1.3 and Elm package version 1.1.0 at the time of this writing).
elm install elm/time
(the generatedPages.elm
has a newbuiltAt
value of typeTime
so this needs to be installed for it to compile).- The
init
function now takes an additional argument, the page you're on when you load the app. You can just add a discarded argument like this. - The
head
function is no longer called fromPages.application
because it now has access to StaticHttp data. Instead, it is part of theview
function, see this diff.