Skip to content

Add support for LocalDev.elm modules #46

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

Open
wants to merge 6 commits into
base: lamdera-next
Choose a base branch
from
Open

Conversation

pithub
Copy link
Member

@pithub pithub commented Apr 10, 2025

This lets you split the code for LocalDev.elm into multiple modules, which can be useful to add multiple "plugins" like the REPL or program-test.

All modules in extra/LocalDev/LocalDev will be installed automatically in the user project's elm-stuff/lamdera folder and can therefore be imported in extra/LocalDev/LocalDev.elm.

When developing new versions of LocalDev.elm or its modules, all changes will be detected automatically and will override the standard versions in elm-stuff/lamdera, so the new versions can be tested without having to re-build the compiler.

@pithub
Copy link
Member Author

pithub commented May 11, 2025

Commit 5f9244f splits the code in extra/LocalDev into two sub-directories: runtime-src and tooling-src (see here). Quote from the readme.md:

The runtime-src/LocalDev.elm file is what gets paged in as the entry point for lamdera live. It may import other files from the runtime-src directory.

The files in tooling-src are not used in the final compiler build, they are only here to assist editor tooling when developing runtime-src/LocalDev.elm.

At runtime, the whole subtree under runtime-src is copied into the local project's elm-stuff/lamdera directory. This allows for example to add vendored packages like elm-composer.

@supermario
Copy link
Member

Looking good – will test shortly.

We should also update the notes in https://github.com/lamdera/compiler/blob/lamdera-next/extra/readme.md#livejs

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