Permalink
Browse files

[cleanup] stdlib,slicer,audit: partial removal of bad annotation

  • Loading branch information...
1 parent 07a5d4e commit b730da8552602044073f868f718686a10a10cdc4 @OpaOnWindowsNow OpaOnWindowsNow committed Dec 11, 2012
@@ -1,5 +1,5 @@
/*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of Opa.
@@ -203,7 +203,7 @@ CLogin = {{
/**
* Get the credential value from the login component.
*/
- @server @publish
+ @server
get_credential(login:CLogin.t('a,'b,'c)):'c =
UserContext.execute(login.config.get_credential, login.state)
@@ -1,5 +1,5 @@
/*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of Opa.
@@ -51,7 +51,6 @@ type WeatherWidget.config = {
CWeather = {{
@private
- @server
s_onmessage(_, msg) =
match msg with
| {weather_for=location; ~config; reply_to=channel} ->
@@ -59,7 +59,6 @@ dom_event_to_opa_event(e) = (%% bslClientOnly.dom_event_to_opa_event %%)(e)
type native_event = external
-@both
FunAction = {{
/**
@@ -102,27 +102,30 @@ Turkic/Altaic family
}}
-@server
@private
-@publish
UserI18n =
{{
get_lang_opt() = UserContext.execute(id->id,UC)
+ @publish
get_lang():I18n.language =
match thread_context().key
{client=_} -> get_lang_opt()
? do Log.warning("I18n","ServerI18n.page_lang should have access to the lang")
ServerI18n.get_server_lang()
_ -> ServerI18n.get_server_lang()
+ @publish
set_lang(l:I18n.language) =
match thread_context().key
{client=_} -> UserContext.change(_->some(l), UC)
_ -> ServerI18n.set_server_lang(l)
// Associate cookies and users
+
+
@private
+ @server_private
UC = UserContext.make(none):UserContext.t(option(I18n.language))
}}
@@ -397,7 +397,7 @@ type Cell.timeout = {
type middle('msg, 'ctx) = external
-@server Cell_Server = {{
+Cell_Server = {{
Dispatcher = {{
@@ -58,9 +58,9 @@
/* Export module OpaRPC_Server*/
-@opacapi @server OpaRPC_Server_send_to_client = OpaRPC_Server.send_to_client
-@opacapi @server OpaRPC_Server_async_send_to_client = OpaRPC_Server.async_send_to_client
-@opacapi @server OpaRPC_Server_Dispatcher_register = OpaRPC_Server.Dispatcher.register
-@opacapi @server OpaRPC_Server_try_cache = OpaRPC_Server.try_cache
+@opacapi @server_private OpaRPC_Server_send_to_client = OpaRPC_Server.send_to_client
+@opacapi @server_private OpaRPC_Server_async_send_to_client = OpaRPC_Server.async_send_to_client
+@opacapi @server_private OpaRPC_Server_Dispatcher_register = OpaRPC_Server.Dispatcher.register
+@opacapi @server_private OpaRPC_Server_try_cache = OpaRPC_Server.try_cache
@opacapi Scheduler_push = Scheduler.push
@@ -335,7 +335,7 @@ Session = {{
* server1 ... --chan-directory own
* server2 ... --chan-directory ipserver1
*/
- @publish @server make_shared(key : string, state : 'state, on_message : ('state, 'message -> Session.instruction('state))) =
+ @publish make_shared(key : string, state : 'state, on_message : ('state, 'message -> Session.instruction('state))) =
// do accept_make_at()
#<Ifstatic:OPA_CHANNEL>
_ = (key, state, on_message)
@@ -381,7 +381,7 @@ Session = {{
* @param state As in [Session.make]
* @param on_message As in [Session.make]
**/
- @server cloud(key, state, handler) =
+ cloud(key, state, handler) =
if cloud_mode
then make_shared(key, state, handler)
else get_local_cloud(key, state, handler)
@@ -435,7 +435,7 @@ Session = {{
* [make_at state handler channel] Like [make state handler] but
* the session is created on the server that own the given channel.
*/
- @server make_at(state: 'state, on_message : ('state, 'message -> Session.instruction('state)), session :channel('a)) =
+ make_at(state: 'state, on_message : ('state, 'message -> Session.instruction('state)), session :channel('a)) =
match get_endpoint(session) with
| {none} -> /* Make here */
make(state, on_message)
@@ -146,7 +146,7 @@ type DynamicResource.message =
* {1 Interface}
*/
-@server DynamicResource = {{
+DynamicResource = {{
/**
* Interaction with the global state of the dynamic resources.
@@ -198,7 +198,7 @@ type DynamicResource.message =
@private find_resource(key) =
Option.get(Cell.call(resourceCell, { get = key }))
- @private next_key =
+ @private @server next_key =
fresh = Fresh.server(i->i)
((prefix:string), (sufix:string) ->
id = fresh()
@@ -30,7 +30,7 @@ import stdlib.core.{js, rpc.core, pack}
* {1 Interface}
*/
-@server Client_code = {{
+Client_code = {{
// Note: defaults for pack.opa are littleEndian, Signed, Longlong
@private D = Pack.Decode
@@ -184,6 +184,7 @@ import stdlib.core.{js, rpc.core, pack}
JsAst.js_codes_to_string(server_asts,asts)
@private
+ @server_private
css_files = Server_reference.create([]:list(string))
register_css_file(css_file:string) : void =
@@ -944,6 +944,14 @@ Dom = {{
else
Log.info("Dom.transform", "empty DOM selection {to_string(jq)}")
+ @private @publish
+ optimize_action(action:Dom.transformation): Dom.transformation = match action with
+ | {~jq ~subject ~verb} ->
+ match subject with
+ | {~content} -> {~jq ~verb subject={content = Xhtml.precompile(content)}}
+ | _ -> action //TODO: Precompile CSS?
+ end
+ | _ -> action
/**
* Exec a list of actions
@@ -953,15 +961,7 @@ Dom = {{
transform(l:list(Dom.transformation)):void =
@sliced_expr(
{client = transform_on_client(l)
- server =
- optimize(action:Dom.transformation): Dom.transformation = match action with
- | {~jq ~subject ~verb} ->
- match subject with
- | {~content} -> {~jq ~verb subject={content = Xhtml.precompile(content)}}
- | _ -> action //TODO: Precompile CSS?
- end
- | _ -> action
- transform_on_client(List.map(optimize, l))
+ server = transform_on_client(List.map(optimize_action, l))
})
/**
@@ -53,7 +53,7 @@ XhtmlOptions = {{
anonymous = []
}
- @private @server @publish // i.e. published for options (see above)
+ @private @publish // i.e. published for options (see above)
p_options = CommandLine.filter(commandline)
}}
@@ -680,7 +680,7 @@ with a linebreak
* @param opt Markdown configuration
* @param src Source string
*/
- @publish @server of_string(_opt:Markdown.options, src:string):Markdown.t =
+ @server of_string(_opt:Markdown.options, src:string):Markdown.t =
src = "{src} "
parts = String.replace("\r", "", src)
|> String.explode_with("\n", _, false)
@@ -721,7 +721,7 @@ with a linebreak
* @param opt Markdown configuration
* @param src Markdown source element
*/
- @publish @server to_xhtml(opt:Markdown.options, src:Markdown.t) =
+ @server to_xhtml(opt:Markdown.options, src:Markdown.t) =
List.fold(
elt, acc ->
acc <+> break <+> aux_block(opt, src.refs)(elt),
@@ -735,7 +735,7 @@ with a linebreak
* @param opt Markdown configuration
* @param src Source string
*/
- @publish @server xhtml_of_string(opt:Markdown.options, src:string):xhtml =
+ @server xhtml_of_string(opt:Markdown.options, src:string):xhtml =
of_string(opt, src) |> to_xhtml(opt, _)
// maybe use WNotification widget?

0 comments on commit b730da8

Please sign in to comment.