Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib: Rename firebug to console #1802

Merged
merged 3 commits into from
Jan 20, 2025
Merged
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
21 changes: 11 additions & 10 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# dev

## Features/Changes
* Lib: fix the type of some DOM properties and methods (#1747)
* Test: use dune test stanzas (#1631)
* Merged Wasm_of_ocaml (#1724)
* Lib: removed no longer relevant Js.optdef type annotations (#1769)
* Misc: drop support for IE
* Effects: add an optional feature of "dynamic switching" between CPS
* Compiler/Runtime: Make resuming a continuation more efficient in js (#1765)
* Compiler/Runtime: Effects: add an optional feature of "dynamic switching" between CPS
and direct style, resulting in better performance when
no effect handler is installed
* Compiler/Runtime: Make resuming a continuation more efficient in js (#1765)
* Compiler: Merged Wasm_of_ocaml (#1724)
* Lib: fix the type of some DOM properties and methods (#1747)
* Lib: removed no longer relevant Js.optdef type annotations (#1769)
* Lib: Add other textMetrics property (#1784)
* Misc: move tests to OCaml 5.3
* Lib: rename Firebug to Console (#1802)
* Test: use dune test stanzas (#1631)
* Test: run wasm tests on windows
* Misc: drop support for IE
* Misc: move tests to OCaml 5.3

## Bug fixes
* Fix small bug in global data flow analysis (#1768)
* Compiler: Fix small bug in global data flow analysis (#1768)
* Runtime: no longer leak channels
* Fix Marshal.to_buffer (#1798)
* Runtime: Fix Marshal.to_buffer (#1798)

# 5.9.1 (02-12-2024) - Lille

Expand Down
2 changes: 1 addition & 1 deletion examples/graph_viewer/viewer_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Format.eprintf "REDRAW %d %d %d %d@." x' y' w h;
let dx = pm.valid_rect.x - x0 in
let dy = pm.valid_rect.y - y0 in
(*
Firebug.console##log_6 (dx, pm.valid_rect.width, a.width,
Console.console##log_6 (dx, pm.valid_rect.width, a.width,
dy, pm.valid_rect.height, a.height);
*)
if
Expand Down
28 changes: 14 additions & 14 deletions examples/graph_viewer/viewer_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,18 @@ let start () =
if not !started then p##.style##.display := Js.string "inline";
Lwt.return ());
(*
Firebug.console##time(Js.string "loading");
Console.console##time(Js.string "loading");
*)
getfile "scene.json"
>>= fun s ->
(*
Firebug.console##timeEnd(Js.string "loading");
Firebug.console##time(Js.string "parsing");
Console.console##timeEnd(Js.string "loading");
Console.console##time(Js.string "parsing");
*)
let (x1, y1, x2, y2), bboxes, scene = of_json ~typ:[%json: scene] s in
(*
Firebug.console##timeEnd(Js.string "parsing");
Firebug.console##time(Js.string "init");
Console.console##timeEnd(Js.string "parsing");
Console.console##time(Js.string "init");
*)
started := true;
Dom.removeChild doc##.body p;
Expand Down Expand Up @@ -350,7 +350,7 @@ let start () =
let redraw_queued = ref false in
let update_view _force =
(*
Firebug.console##log_2(Js.string "update", Js.date##now());
Console.console##log_2(Js.string "update", Js.date##now());
*)
let a = allocation () in
let scale = get_scale () in
Expand Down Expand Up @@ -389,7 +389,7 @@ Firebug.console##log_2(Js.string "update", Js.date##now());
if not !redraw_queued then
ignore (redraw_queued := true;
(*
Firebug.console##log(Js.string "sleep");
Console.console##log(Js.string "sleep");
*)
Lwt_js.yield() >>= fun () ->
redraw_queued := false;
Expand Down Expand Up @@ -502,15 +502,15 @@ Firebug.console##log(Js.string "sleep");
(*
Html.addEventListener Html.document Html.Event.keydown
(Html.handler
(fun e -> Firebug.console##log(e##keyCode);
(fun e -> Console.console##log(e##keyCode);
Js._true))
Js._true;
*)
(*
Html.addEventListener Html.document Html.Event.keypress
(Html.handler
(fun e ->
Firebug.console##log(Js.string "press");
Console.console##log(Js.string "press");
match e##keyCode with
| 37 -> (* left *)
Js._false
Expand All @@ -521,7 +521,7 @@ Firebug.console##log(Js.string "sleep");
| 40 -> (* down *)
Js._false
| _ ->
Firebug.console##log(- 1- e##keyCode);
Console.console##log(- 1- e##keyCode);
Js._true))
Js._true;
*)
Expand Down Expand Up @@ -549,7 +549,7 @@ Firebug.console##log(Js.string "sleep");
Js._false
| _ ->
(*
Firebug.console##log_2(Js.string "keycode:", ev##keyCode);
Console.console##log_2(Js.string "keycode:", ev##keyCode);
*)
Js._true
in
Expand All @@ -564,12 +564,12 @@ Firebug.console##log(Js.string "sleep");
ignored_keycode := -1;
if e##.keyCode = k then Js._true else handle_key_event e);
(*
Firebug.console##time(Js.string "initial drawing");
Console.console##time(Js.string "initial drawing");
*)
update_view true;
(*
Firebug.console##timeEnd(Js.string "initial drawing");
Firebug.console##timeEnd(Js.string "init");
Console.console##timeEnd(Js.string "initial drawing");
Console.console##timeEnd(Js.string "init");
*)
Lwt.return ()

Expand Down
16 changes: 8 additions & 8 deletions examples/hyperbolic/hypertree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ let language =
(Html.window##.localStorage##getItem (Js.string "hyp_lang"))
default_language)

let _ = Firebug.console##log !language
let _ = Console.console##log !language

let set_language lang =
Html.window##.localStorage##setItem (Js.string "hyp_lang") lang;
Expand Down Expand Up @@ -643,7 +643,7 @@ type boxes =
let shadow = false

let draw canvas vertices edges nodes boxes =
Firebug.console##time (Js.string "draw");
Console.console##time (Js.string "draw");
let c = canvas##getContext Html._2d_ in
let ((rx, ry, dx, dy) as transf) = screen_transform canvas in
c##clearRect
Expand Down Expand Up @@ -795,8 +795,8 @@ let draw canvas vertices edges nodes boxes =
(Js.float (2. *. h))
| `Txt (_, None, _) | `None -> ()
done;
Firebug.console##timeEnd (Js.string "draw");
Firebug.console##log_2 !image_count !large_image_count
Console.console##timeEnd (Js.string "draw");
Console.console##log_2 !image_count !large_image_count

let tree_url = "tree.json"

Expand Down Expand Up @@ -1239,7 +1239,7 @@ let show_image all_messages image_info name small_image =
if !i >= 0
then (
let info = image_info.(!i) in
Firebug.console##log_2 name !i;
Console.console##log_2 name !i;
let d = Html.document in
let container = Html.createDiv d in
container##.style##.margin := Js.string "10px";
Expand Down Expand Up @@ -1582,7 +1582,7 @@ let start _ =
(redraw_funct :=
fun () ->
need_redraw := false;
Firebug.console##time (Js.string "transform");
Console.console##time (Js.string "transform");
(*
let transf = hyp_transf !tr' in
for i = 0 to Array.length vertices - 1 do
Expand All @@ -1596,7 +1596,7 @@ let start _ =
canvas##.width := w;
canvas##.height := h);
hyp_transf_vect !tr' vertices vertices';
Firebug.console##timeEnd (Js.string "transform");
Console.console##timeEnd (Js.string "transform");
draw canvas vertices' edges nodes boxes);
perform_redraw ();
Html.window##.onresize :=
Expand Down Expand Up @@ -1692,7 +1692,7 @@ debug_msg (Format.sprintf "Resize %d %d" w h);
handle_touch_events
canvas
(fun x0 y0 x1 y1 ->
Firebug.console##time (Js.string "transform");
Console.console##time (Js.string "transform");
let z0 = from_screen canvas x0 y0 in
let z1 = from_screen canvas x1 y1 in
(*
Expand Down
2 changes: 1 addition & 1 deletion examples/test_wheel/test_wheel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let () =
in
html##.onwheel :=
Dom.handler (fun (event : Dom_html.mousewheelEvent Js.t) ->
Firebug.console##debug event;
Console.console##debug event;
let deltaX = event##.deltaX in
let deltaY = event##.deltaY in
let deltaZ = event##.deltaZ in
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl/webgldemo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ open Js
let error f =
Printf.ksprintf
(fun s ->
Firebug.console##error (Js.string s);
Console.console##error (Js.string s);
failwith s)
f

let debug f = Printf.ksprintf (fun s -> Firebug.console##log (Js.string s)) f
let debug f = Printf.ksprintf (fun s -> Console.console##log (Js.string s)) f

let alert f =
Printf.ksprintf
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/js_of_ocaml/firebug.mli → lib/js_of_ocaml/console.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)

(** Firebug API (debugging console).
(** Console API (debugging console).

The Firebug console API
The console API
*)

open Js
Expand Down
4 changes: 2 additions & 2 deletions lib/js_of_ocaml/geolocation.mli
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
let f_success pos =
let coords = pos##.coords in
let latitude = coords##.latitude in
Firebug.console##debug latitude ;
Console.console##debug latitude ;
in
let f_error err =
let code = err##.code in
let msg = err##.message in
if code = err##._TIMEOUT then Firebug.console##debug(msg)
if code = err##._TIMEOUT then Console.console##debug(msg)
in
geo##getCurrentPosition (Js.wrap_callback f_success) (Js.wrap_callback f_error) options
]}
Expand Down
6 changes: 3 additions & 3 deletions lib/js_of_ocaml/intl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

open Js ;;

let fc v = Firebug.console##debug v in
let fc v = Console.console##debug v in

let jas a = array(Array.map (fun v -> string v) a) in

Expand Down Expand Up @@ -410,10 +410,10 @@ if (Intl.is_supported()) then (
) ;

with
| Error err -> Firebug.console##debug (
| Error err -> Console.console##debug (
string (string_of_error err)) ;
) else (
Firebug.console##debug (string "Intl is not supported!") ;
Console.console##debug (string "Intl is not supported!") ;
)

]}
Expand Down
4 changes: 3 additions & 1 deletion lib/js_of_ocaml/js_of_ocaml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
*)

module CSS = CSS
module Console = Console
module Dom = Dom
module Dom_events = Dom_events
module Dom_html = Dom_html
module Dom_svg = Dom_svg
module Effect_js = Effect_js
module EventSource = EventSource
module File = File
module Firebug = Firebug
module Firebug = Console
[@@ocaml.deprecated "[since 6.0] Use Js_of_ocaml.Console instead."]
module Form = Form
module Geolocation = Geolocation
module IntersectionObserver = IntersectionObserver
Expand Down
4 changes: 2 additions & 2 deletions lib/js_of_ocaml/mutationObserver.mli
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
in
let node = (target :> Dom.node Js.t) in
let f records observer =
Firebug.console##debug records ;
Firebug.console##debug observer
Console.console##debug records ;
Console.console##debug observer
in
MutationObserver.observe ~node ~f
~attributes:true ~child_list:true ~character_data:true
Expand Down
4 changes: 2 additions & 2 deletions lib/js_of_ocaml/performanceObserver.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
let entry_types = [ "measure" ] in
let f entries observer =
let entries = entries##getEntries in
Firebug.console##debug entries ;
Firebug.console##debug observer
Console.console##debug entries ;
Console.console##debug observer
in
PerformanceObserver.observe ~entry_types ~f
()
Expand Down
4 changes: 2 additions & 2 deletions lib/js_of_ocaml/resizeObserver.mli
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
in
let node = (target :> Dom.node Js.t) in
let f entries observer =
Firebug.console##debug entries;
Firebug.console##debug observer
Console.console##debug entries;
Console.console##debug observer
in
ResizeObserver.observe ~node ~f
~box:(Js.string "content-box")
Expand Down
16 changes: 8 additions & 8 deletions lib/lwt/log/lwt_log_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ let console =
(Printf.sprintf "[%s] %s" (Section.name section) (String.concat "\n" logs))
in
(match level, Lwt.get js_val with
| Debug, None -> Firebug.console##debug str
| Debug, Some v -> Firebug.console##debug_2 str v
| Info, None | Notice, None -> Firebug.console##info str
| Info, Some v | Notice, Some v -> Firebug.console##info_2 str v
| Warning, None -> Firebug.console##warn str
| Warning, Some v -> Firebug.console##warn_2 str v
| Error, None | Fatal, None -> Firebug.console##error str
| Error, Some v | Fatal, Some v -> Firebug.console##error_2 str v);
| Debug, None -> Console.console##debug str
| Debug, Some v -> Console.console##debug_2 str v
| Info, None | Notice, None -> Console.console##info str
| Info, Some v | Notice, Some v -> Console.console##info_2 str v
| Warning, None -> Console.console##warn str
| Warning, Some v -> Console.console##warn_2 str v
| Error, None | Fatal, None -> Console.console##error str
| Error, Some v | Fatal, Some v -> Console.console##error_2 str v);
Lwt.return_unit)

let log ?inspect ?exn ?section ?location ?logger ~level message =
Expand Down
2 changes: 1 addition & 1 deletion lib/lwt/lwt_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let wakeup = function

let () = Lwt.register_pause_notifier wakeup

let prerr_string s = Firebug.console##log (Js.string s)
let prerr_string s = Console.console##log (Js.string s)

let _ =
Lwt.async_exception_hook :=
Expand Down
4 changes: 2 additions & 2 deletions lib/lwt/lwt_js_events.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let with_error_log f x =
Lwt.catch
(fun () -> f x)
(fun e ->
Firebug.console##log (Js.string (Printexc.to_string e));
Console.console##log (Js.string (Printexc.to_string e));
Lwt.return ())

let seq_loop evh ?(cancel_handler = false) ?use_capture ?passive target handler =
Expand Down Expand Up @@ -330,7 +330,7 @@ let mousewheel ?use_capture ?passive target =
?passive:(opt_map Js.bool passive)
target
(fun (ev : #Dom_html.event Js.t) ~dx ~dy ->
Firebug.console##log ev;
Console.console##log ev;
cancel ();
Lwt.wakeup w (ev, (dx, dy));
Js.bool true)
Expand Down
2 changes: 1 addition & 1 deletion lib/lwt/lwt_jsonp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let raw_call name uri error_cb user_cb =
if !executed
then Lwt.return_unit
else (
Firebug.console##warn
Console.console##warn
(Js.string "Jsonp: script loaded but callback not executed");
finalize ();
error_cb x;
Expand Down
2 changes: 1 addition & 1 deletion tools/ci_setup.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let dune_workspace =
(_
(env-vars (TESTING_FRAMEWORK inline-test))
(js_of_ocaml (enabled_if false))
(flags :standard -warn-error -7-8-27-30-32-34-37-49-52-55 -w -7-27-30-32-34-37-49-52-55-58-67-69)))
(flags :standard -alert -all -warn-error -7-8-27-30-32-34-37-49-52-55 -w -7-27-30-32-34-37-49-52-55-58-67-69)))
|}

let node_wrapper =
Expand Down
Loading
Loading