Closed jchavarri closed 2 months ago
I had a case where I used browser_only in some event handler using a curried function, e.g.:
browser_only
onKeyDown=[%browser_only onKeyDown(~foo) ]
This code converted to plain Runtime.fail_impossible_action_in_ssr, crashing the server application at runtime.
Runtime.fail_impossible_action_in_ssr
This PR removes some of the cases where browser_only can be used:
so this extension can only be used to convert function definitions.
Users can still use switch%platform for identifiers and function applications, which prevents running on footguns like the one mentioned above.
switch%platform
I had a case where I used
browser_only
in some event handler using a curried function, e.g.:This code converted to plain
Runtime.fail_impossible_action_in_ssr
, crashing the server application at runtime.This PR removes some of the cases where
browser_only
can be used:so this extension can only be used to convert function definitions.
Users can still use
switch%platform
for identifiers and function applications, which prevents running on footguns like the one mentioned above.