Skip to content
This repository
tree: 70ad91428e
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 99 lines (78 sloc) 2.905 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
(*
Copyright © 2011 MLstate

This file is part of OPA.

OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.

OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.

You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)

(*
Mathieu Sat Oct 30 11:16:54 CEST 2010
We need simplicity in design, and identified dependencies.

I considere all "roots" things as a terrible hack, but I agree that we have not yet
a better mechanism.
We should e.g. be able to add a toplevel directive in the opa definition of the identifiers
for highlighting roots. In that way, the information would be closed to the opa-source code,
not hidden in this file.

@root serialize = ....
*)

let roots_for_s3
    ~no_server
    =
  (* FIXME: use opacapi *)
  let pass_ei = [
    Opacapi.OpaType.instantiate_col;
    Opacapi.OpaType.instantiate_row;
  ] in

  let pass_resolveRemoteCalls = [
    Opacapi.OpaTsc.implementation;

    Opacapi.OpaSerialize.serialize;
    Opacapi.OpaSerialize.serialize_for_js;
    Opacapi.OpaSerialize.unserialize;
    Opacapi.OpaSerialize.unserialize_unsafe;

    Opacapi.OpaRPC.serialize;
    Opacapi.OpaRPC.empty_request;
    Opacapi.OpaRPC.add_var_types;
    Opacapi.OpaRPC.add_row_types;
    Opacapi.OpaRPC.add_col_types;
    Opacapi.OpaRPC.add_args_with_type;
    Opacapi.OpaRPC.unserialize;
    Opacapi.OpaRPC.extract_types;
    Opacapi.OpaRPC.extract_values;
    Opacapi.OpaRPC.empty_request;

    Opacapi.OpaRPC.client_send_to_server;
    Opacapi.OpaRPC.client_async_send_to_server;

    Opacapi.OpaRPC.server_send_to_client;
    Opacapi.OpaRPC.server_async_send_to_client;

    Opacapi.OpaRPC.fake_stub;
    Opacapi.OpaRPC.error_stub;

    Opacapi.OpaRPC.client_dispatcher_register;
    Opacapi.OpaRPC.server_dispatcher_register;

    Opacapi.OpaRPC.client_try_cache;
    Opacapi.OpaRPC.server_try_cache;

    Opacapi.Opa2Js.to_string
    ] in

  let pass_FunAction = [
    Opacapi.FunActionServer.serialize_call ;
    Opacapi.FunActionServer.serialize_argument ;
    Opacapi.FunActionServer.serialize_ty_argument ;
  ] in

  let pass_JavascriptCompilation = [
    Opacapi.callFA; (* because used in a @js_ident *)
    Opacapi.Client_code.register_js_code ;
    Opacapi.Core_server_code.register_server_code;
    Opacapi.Client_code.register_js_code_elt ;
    Opacapi.Client_code.register_css_declaration ;
  ] in

  if no_server then
    pass_ei
  else
    pass_resolveRemoteCalls
    @ pass_ei
    @ pass_FunAction
    @ pass_JavascriptCompilation
Something went wrong with that request. Please try again.