package ppx_platform
Platform-specific code for native and Melange builds
Install
dune-project
Dependency
Authors
Maintainers
Sources
ppx_platform-0.3.0.tbz
sha256=be1ae7c2cacdef9f21b0822b728d854bc77fa6181276e1b47db06b49a80531e5
sha512=bd428092b3ec062ff294a02619ed4441d451d1965021f3f7074244b2448687f03fa03c0eb320b112a8660cac8bee552bfb711a0bb458deacccccfd3979fda860
doc/CHANGES.html
Changes
0.3.0
- Breaking: the runtime module
Ppx_platform_runtimeis nowPpx_platform.exception Impossible_in_ssr of stringis nowexception Melange_only of string, andfail_impossible_action_in_ssris nowfail_melange_only. It prints a hint and the call stack to stderr only when backtraces are on (OCAMLRUNPARAM=borPrintexc.record_backtrace true), then raises. The library name of the ppx is nowppx_platform_ppx. The public namesppx_platformandppx_platform.runtimedo not change. Breaking: remove the old names. Until 1.0.0, each one is an error that names its replacement, so a migration finds every leftover. Replace each one as follows:
Removed
Use
let%browser_only,[%browser_only ...],[%%browser_only ...]let%melange_only,[%melange_only ...],[%%melange_only ...][@browser_only],[@@browser_only],[@platform js],[@@platform js][@melange_only],[@@melange_only][@platform native],[@@platform native][@native_only],[@@native_only]Server,Runtime.Serverinmatch%platform/switch%platformNativeClient,Runtime.Clientinmatch%platform/switch%platformMelange- Breaking: the
browser_onlyalert is gone. Native code gets amelange_onlyalert with a new message: "This value only exists in the Melange build. Use it inside a let%melange_only function, or a Melange branch of match%platform." - Error messages that said
[browser_ppx]orbrowser_onlynow say[ppx_platform]andmelange_only.
0.2.0
- Add
NativeandMelangecases tomatch%platform/switch%platform.Server,Client,Runtime.ServerandRuntime.Clientstill work and can be mixed with the new cases. - Add
[@melange_only]/[@@melange_only],let%melange_onlyand[%melange_only ...], the new names of[@browser_only]/[@platform js]andbrowser_only. Native code gets amelange_onlyalert, notbrowser_only. - Add
[@native_only]/[@@native_only], the new name of[@platform native]. - The old names keep working in this release and will be removed in 1.0.0.
0.1.0
Initial release, extracted from browser_ppx in server-reason-react.
- Add
let%browser_only,%browser_onlyexpressions and the[@browser_only]attribute. - Add
[@platform js]and[@platform native]attributes. - Add
switch%platformwithServer/ClientandRuntime.Server/Runtime.Clientpatterns. - Add the
-jsdriver flag to preprocess for Melange. - Add
ppx_platform.runtime, with thePpx_platform_runtimemodule that the generated code calls.