-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
All case which have a prefix won't be logged. In the generated js files the code for logging is missing. It took a while to find out but now i have a minimal example:
// RSLoggerBugExample.res
module Page = {
type t =
| Home
| Profile
| Welcome
}
@react.component
let make = (~page) =>
@log
switch page {
| Page.Welcome => "Hello World"->React.string
| Home => "Hello Home"->React.string
| Page.Profile => "Hello Profile"->React.string
}
// RSLoggerBugExample.bs.js
function RSLoggerBugExample(Props) {
var page = Props.page;
switch (page) {
case /* Home */0 :
Browser$ReScriptLogger.debug({
rootModule: "RSLoggerBugExample",
subModulePath: /* [] */0,
value: "make",
fullPath: "RSLoggerBugExample.make",
filePath: "absolute path to the res file which a can not disable, but that is another issue :D"
}, "Home");
return "Hello Home";
case /* Profile */1 :
return "Hello Profile";
case /* Welcome */2 :
return "Hello World";
}
}
I got this issue originally in the old reason-syntax. But I could reproduce this bug also in rescript. I'm using [email protected] & [email protected]
Metadata
Metadata
Assignees
Labels
No labels