Skip to content

Commit d09bf78

Browse files
committed
Spike lamdera live in --optimize-legible mode
1 parent e8342a9 commit d09bf78

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

builder/src/Generate.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ repl root details ansi (Build.ReplArtifacts home modules localizer annotations)
101101

102102
checkForDebugUses :: Objects -> Task ()
103103
checkForDebugUses (Objects _ locals) =
104-
case Map.keys (Map.filter Nitpick.hasDebugUses locals) of
105-
[] -> return ()
106-
m:ms -> Task.throw (Exit.GenerateCannotOptimizeDebugValues m ms)
104+
return ()
105+
-- case Map.keys (Map.filter Nitpick.hasDebugUses locals) of
106+
-- [] -> return ()
107+
-- m:ms -> Task.throw (Exit.GenerateCannotOptimizeDebugValues m ms)
107108

108109

109110

extra/Lamdera/Injection.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ behaviors and limitations.
7979
See extra/Lamdera/ReverseProxy.hs for the proxy itself
8080
-}
8181
modifiedHttp_toTask isProd =
82-
onlyIf (not isProd)
82+
-- onlyIf (not isProd)
8383
-- Identical to original except for alterIfProxyRequired addition
8484
[text|
8585

@@ -314,6 +314,18 @@ injections isBackend isLocalDev =
314314
fns: fns
315315
} : {};
316316
}
317+
318+
// Restore Debug.* from dev mode to see what happens
319+
// $$elm$$core$$Debug$$log = _Debug_log_UNUSED;
320+
$$elm$$core$$Debug$$log = F2(function(tag, value)
321+
{
322+
console.log(tag + ': ', value);
323+
return value;
324+
});
325+
// $$elm$$core$$Debug$$toString = _Debug_toString_UNUSED;
326+
327+
// debugger
328+
317329
|]
318330

319331
-- // https://github.com/elm/bytes/issues/20

terminal/src/Develop.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ serveElm sentryCache path =
250250
compileToBuilder :: FilePath -> IO BS.ByteString
251251
compileToBuilder path =
252252
do
253+
_ <- Lamdera.enableLongNames
253254
result <- compile path
254255

255256
pure $
@@ -311,7 +312,7 @@ compile path =
311312
Lamdera.PostCompile.check details artifacts Exit.ReactorBadBuild
312313
Lamdera.TypeHash.buildCheckHashes artifacts
313314

314-
javascript <- Task.mapError Exit.ReactorBadGenerate $ Generate.dev root details artifacts
315+
javascript <- Task.mapError Exit.ReactorBadGenerate $ Generate.prod root details artifacts
315316
let (NE.List name _) = Build.getRootNames artifacts
316317
return $ Html.sandwich root name javascript
317318

0 commit comments

Comments
 (0)