Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@
[submodule "vendor/elm-format"]
path = vendor/elm-format
url = git@github.com:lamdera/elm-format.git
[submodule "extra/package-replacements/elm/virtual-dom"]
path = extra/package-replacements/elm/virtual-dom
url = git@github.com:lydell/virtual-dom.git
branch = hot-reload-stop
[submodule "extra/package-replacements/elm/browser"]
path = extra/package-replacements/elm/browser
url = git@github.com:lydell/browser.git
branch = lamdera
[submodule "extra/package-replacements/elm/html"]
path = extra/package-replacements/elm/html
url = git@github.com:lydell/html.git
branch = safe
[submodule "extra/package-replacements/elm/core"]
path = extra/package-replacements/elm/core
url = git@github.com:lydell/core.git
branch = lamdera
Comment on lines +7 to +22
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve pointed these to my repos while developing, but before merging I think it makes sense to have forks in github.com/lamdera/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not super concerned to fork, but was there a practical reason for it? Like are you worried we might end up needing a Lamdera specific variant, or just a cheap hedge to make now just in case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Simon doesn't want Lamdera to become dependent on his GitHub repositories? If so, maybe we could use Git subtrees instead of submodules. Then Simon's code would be copied into the Lamdera codebase, committed to the Lamdera repo. I used subtrees in some of my projects and found them to work well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I feel slightly uneasy about Lamdera becoming dependent on my repos.

It’s not super “bad”, since the built binaries don’t depend on it, just the lamdera/compiler repo. And even there we are locked to specific commits of my repos, so if I accidentally change or remove a branch it won’t really break anything.

Anyhow, git subtrees might be better. I don’t know. I haven’t used them before. I might try that out after I’ve got the rest of the Haskell code in place.

8 changes: 6 additions & 2 deletions builder/src/Elm/Details.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ import qualified Stuff
import qualified Lamdera
import Lamdera ((&))
import qualified Lamdera.Extensions
import qualified Lamdera.PackageReplacements
import qualified Lamdera.Version

-- DETAILS

Expand Down Expand Up @@ -405,7 +407,7 @@ verifyDep (Env key _ _ cache manager _ _) depsMVar solution pkg details@(Solver.
then
do Reporting.report key Reporting.DCached
maybeCache <- File.readBinary (Stuff.package cache pkg vsn </> "artifacts.dat")
& Lamdera.alternativeImplementation (File.readBinary (Stuff.package cache pkg vsn </> "artifacts.x.dat"))
& Lamdera.alternativeImplementation (File.readBinary (Stuff.package cache pkg vsn </> Lamdera.Version.artifacts))
case maybeCache of
Nothing ->
build key cache depsMVar pkg details fingerprint Set.empty
Expand Down Expand Up @@ -500,7 +502,7 @@ build key cache depsMVar pkg (Solver.Details vsn _) f fs =
Just results ->
let
path = Stuff.package cache pkg vsn </> "artifacts.dat"
& Lamdera.alternativeImplementation (Stuff.package cache pkg vsn </> "artifacts.x.dat")
& Lamdera.alternativeImplementation (Stuff.package cache pkg vsn </> Lamdera.Version.artifacts)
ifaces = gatherInterfaces exposedDict results
objects = gatherObjects results
artifacts = Artifacts ifaces objects
Expand Down Expand Up @@ -622,6 +624,7 @@ crawlModule foreignDeps mvar pkg src docsStatus name =
crawlFile :: Map.Map ModuleName.Raw ForeignInterface -> MVar StatusDict -> Pkg.Name -> FilePath -> DocsStatus -> ModuleName.Raw -> FilePath -> IO (Maybe Status)
crawlFile foreignDeps mvar pkg src docsStatus expectedName path =
do bytes <- File.readUtf8 path
& Lamdera.alternativeImplementationPassthrough (Lamdera.PackageReplacements.get pkg expectedName Lamdera.PackageReplacements.elm)
case Parse.fromByteString (Parse.Package pkg) bytes of
Right modul@(Src.Module (Just (A.At _ actualName)) _ _ imports _ _ _ _ _) | expectedName == actualName ->
do deps <- crawlImports foreignDeps mvar pkg src imports
Expand Down Expand Up @@ -649,6 +652,7 @@ crawlKernel foreignDeps mvar pkg src name =
if exists
then
do bytes <- File.readUtf8 path
& Lamdera.alternativeImplementationPassthrough (Lamdera.PackageReplacements.get pkg name Lamdera.PackageReplacements.kernel)
case Kernel.fromByteString pkg (Map.mapMaybe getDepHome foreignDeps) bytes of
Nothing ->
return Nothing
Expand Down
2 changes: 2 additions & 0 deletions builder/src/Stuff.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ import qualified Elm.Version as V

import Lamdera ((&))
import qualified Lamdera
import qualified Lamdera.Version

-- PATHS


stuff :: FilePath -> FilePath
stuff root =
root </> "elm-stuff" </> compilerVersion
& Lamdera.alternativeImplementation (root </> "elm-stuff" </> Lamdera.Version.medium)


details :: FilePath -> FilePath
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/Generate/Html.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sandwich_ root moduleName javascript =

<body>

<pre id="elm"></pre>
<pre data-elm id="elm"></pre>

<script>
try {
Expand Down
3 changes: 1 addition & 2 deletions extra/Lamdera/CLI/Reset.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ run () () = do
progress $ "Removing artifacts in " <> elmHome
let packageDir = elmHome </> Lamdera.Version.elm </> "packages"
onlyWhen_ (doesDirectoryExist packageDir) $ do
callCommand $ "find " <> packageDir <> " | grep artifacts.dat | xargs rm -r"
callCommand $ "find " <> packageDir <> " | grep artifacts.x.dat | xargs rm -r"
callCommand $ "find " <> packageDir <> " | grep 'artifacts.*\\.dat' | xargs rm -r"
else do
nukeDir elmHome

Expand Down
1 change: 1 addition & 0 deletions extra/Lamdera/Evergreen/Snapshot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ canonicalToFt version scope interfaces recursionSet canonical tvarMap =


-- Kernel concessions for Frontend Model and Msg
("elm", "browser", "Browser.Navigation", "Key") -> ("Browser.Navigation.Key", Set.singleton moduleName, Map.empty)
("elm", "file", "File", "File") -> ("File.File", Set.singleton moduleName, Map.empty)
("elm-explorations", "webgl", "WebGL.Texture", "Texture") -> ("WebGL.Texture.Texture", Set.singleton moduleName, Map.empty)

Expand Down
Loading