Skip to content

New cli release

Compare
Choose a tag to compare
@choonkeat choonkeat released this 10 Oct 12:02
· 28 commits to main since this release

Added 2 new "types". We now total 5 types of apps to be generated:

USAGE:

    elm-webapp <type> <target_directory>

TYPE:

    While the generated "src/Server.elm" is the same, you can choose
    what kind of "src/Client.elm" to generate:

        application             generates a standard "Browser.application"

        document                generates a standard "Browser.document"

        element                 generates a standard "Browser.element"

        application-element     generates a standard "Browser.element" with
                                routing capabilities like "Browser.application"
                                but more compatible with browser extensions

    This generates a different "src/Server.elm" that comes with "CRUD"
    operations with an in-memory server state: Data is preserved on the
    Server only while the Server process is running.

        crud                    generates a standard "Browser.application"
                                with the ability to list, create, edit, and
                                destroy "Foobar" records

EXAMPLE:

    elm-webapp application helloworld

  1. application-element is for generating SPA client code that is more compatible with browser extensions. see https://github.com/jinjor/elm-break-dom and choonkeat/elm-element-navigation#1

  2. crud generates a full CRUD app that persists data in memory; in the ServerState.

crud.demo.mov

The hope is that this helps speed up development; changing the required data easily. Then before releasing the feature, edit the Server.FoobarAPI#updateFromClient code to persist those memory values in an external DB like Hasura or DynamoDB while leaving the developed src/Client.elm code untouched

NOTE: courtesy of npm version, looks like git tags with v prefix will be npm/cli updates