Giter VIP home page Giter VIP logo

eliom's People

Contributors

aik9508 avatar arnaudparant avatar balat avatar benozol avatar ccharly avatar chambart avatar dannywillems avatar dinosaure avatar drup avatar florentbecker avatar ghuysmans avatar glondu avatar guerfelmohamed avatar hhugo avatar hnrgrgr avatar ilankri avatar kit-ty-kate avatar krys27 avatar mfp avatar nurpax avatar paurkedal avatar rluong89 avatar sagotch avatar smorimoto avatar vasilisp avatar vbmithr avatar venator avatar vouillon avatar yakobowski avatar zzull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eliom's Issues

float output for input ~value

Still an issue with this in eliom (see #31 in tyxml)
We should not use string_of_float since the output for 0 is 0. and it doesn't exists in html. My browser ignore it.
I think the problem lies here

Warning 33: unused open Eliom_pervasives

I came across this issue after compiling with all warnings activated: when running the latest Eliom master, opening Eliom_content.Html5.F will trigger "Warning 33: unused open Eliom_pervasives". This did not happen until very recently.

"Wrong parameters" for non localized file parameter

When I submit a form with a non localized file parameter, Eliom doesn't find the service any more; i.e. it returns error 500 and "Wrong Parameters" (visible on the console).

Any idea what's going on?

In a project eliom-distillery -name nofilenl:

open Eliom_lib
open Eliom_content

module Nofilenl_app =
  Eliom_registration.App
    (struct let application_name = "nofilenl" end)

let nl_file =
  Eliom_parameter.make_non_localized_parameters ~prefix:"prefix" ~name:"name" ~persistent:true
    (Eliom_parameter.file "file")

let main_service =
  Eliom_service.Http.service ~path:[] ~get_params:Eliom_parameter.unit ()

let service =
  Nofilenl_app.register_post_coservice' ~post_params:Eliom_parameter.unit
    (fun () () ->
      Lwt.return
        (Eliom_tools.F.html ~title:"nofilenl"
           Html5.F.(body [ pcdata "ok" ])))

let () =
  Nofilenl_app.register
    ~service:main_service
    (fun () () ->
      Lwt.return
        (Eliom_tools.F.html ~title:"nofilenl"
           Html5.F.(body [
             post_form ~service (fun () -> [
               file_input ~name:(Eliom_parameter.get_nl_params_names nl_file) ();
               button ~button_type:`Submit [pcdata "ok"]
             ]) ();
           ])))

Eliom_parameter && GADT

  • does anyone have some work in progress
  • do we need to keep coordinates (TCoord & TCoordv) as "native" type
  • can we merge TOption and TNEOption
  • ...

Add a mini-template syntax

Some users wants a template syntax, but IMHO it's not what we want. Instead, we can have (yet) another syntax extension for making the html result more readable.

Here is my proposal for this syntax:

let s = pcdata in
let delete = a ~service:Services.delete_feed [s "delete"] () in
let edit = a ~service:Services.edit_feed [s "edit"] () in
TMPL(s) "($delete | $edit)"

This syntax is PGOCaml-like so it should be doable and it's definitively more readable than (the code produced):

[s "("; delete; s " | "; edit; s ")"]

So this extension is more or less a format-like syntax that produce an html elements list.
The parameter of TMPL is the function used for insert strings (in most cases, it's pcdata).

Eliom does not compile

I have a error during compilation.

File "eliom_content_core.ml", line 232, characters 38-64:
Error: This expression has type
Eliom_xml.event_handler = Eliom_lib.RawXML.event_handler
but an expression was expected of type string

[Testsuite] too much recursion

This message too much recursion appeases on client side with the testsuite (at least) on the pages:

  • tmlp1/page1
  • tmpl1/page2
  • tmpl1/page3
  • tmpl2/page1
  • tmpl2/page2

New syntax extension

I'm planning to do a new syntax extension, using the new extension-point mechanism and following some ideas from Alain Frisch.
The syntax would look like this :

let@sh bla = 3 (* A shared declaration *)
let@s blu = "blu" (* A server declaration *)
let x = ( "blop" )@cval (* A client value *)

[%%client ] (* The beginning of a server section *)
let a = ... 
let b = ...

There is something a bit touchy : injections. I havn't study the question enough to have an opinion on it.

I didn't even begin to work on this, and we have quite some time since extension-points just got only merge on the trunck. Any feedback on the syntax and ideas about this would be appreciated.

hopefully, this new syntax should fix some bugs like #18.

'Camlp4: Uncaught exception: DynLoader.Error' on fresh eliom-destillery

This happens on both make test.opt and make test.byte. Anyone know what's going on? Thanks!

10:48:05 norml (master)$ make test.opt
mkdir -p local/etc/norml
sed -e "/^ *%%%/d" -e "s|%%PROJECT_NAME%%|norml|g" -e "s|%%DATABASE_NAME%%||g" -e "s|%%DATABASE_USER%%||g" -e "s|%%CMDPIPE%%|%%PREFIX%%var/run/norml-cmd|g" -e "s|%%LOGDIR%%|%%PREFIX%%var/log/norml|g" -e "s|%%DATADIR%%|%%PREFIX%%var/data/norml|g" -e "s|%%PERSISTENT_DATA_BACKEND%%|dbm|g" -e "s|%%LIBDIR%%|%%PREFIX%%var/lib/norml|g" -e "s|%%WARNING%%|DON\'T EDIT THIS FILE! It is generated from norml.conf.in, edit that one, or the variables in Makefile.options|g" -e "s|%%PACKAGES%%||g" -e "s|%%ELIOMSTATICDIR%%|%%PREFIX%%var/www/norml/eliom|g" -e "s|%%DEBUGMODE%%||g" -e "s|%%PORT%%|8080|g" -e "s|%%STATICDIR%%|static|g" -e "s|%%USERGROUP%%||g" norml.conf.in | sed -e "s|%%PREFIX%%|local/|g" > local/etc/norml/norml-test.conf
mkdir -p local/var/data/norml
mkdir -p local/var/lib/norml
mkdir -p local/var/log/norml
mkdir -p local/var/www/norml/static
mkdir -p local/var/www/norml/eliom
mkdir -p local/var/run
js_of_eliom -c   norml.eliom
Camlp4: Uncaught exception: DynLoader.Error ("/Users/rob/.opam/4.00.1/lib/deriving-ocsigen/pa_deriving.cma", "interface mismatch on Camlp4_import")

File "norml.eliom", line 1:
Error: Preprocessor error
make: *** [_client/norml.cmo] Error 2

Eliom_service.OCaml does not work on client side.

Hi,

Eliom_service.OCaml does not work on client side.
Unbound Module

In case of mobile application, we need to delare service in shared side. It is due to mobile application which start on client side.

It will be very useful to allow it, because we can not use directly server function.

Before that Eliom changed (Eliom_service.service), we could do it.
We can do it with Unsafe one, I think it is like the old one but I would like to avoid it.

Eliom_service.OCaml and Eliom_registration.Ocaml

Eliom_service.OCaml module and Eliom_registration.Ocaml module should have the same name.

In Eliom_service it is named OCaml (with a capitalized 'C') while in Eliom_registration, it is named Ocaml (with a non-capitalized 'c').

Here a command to show the difference (in an eliom repository):

$> cat src/server/eliom_service.mli | grep "module OCa" && cat src/server/eliom_registration.mli | grep "module Oca"
module OCaml : "sigs/eliom_service.mli"
module Ocaml : "sigs/eliom_reg_simpl.mli"

I think that it should be named Ocaml.

Recompilation of eliom.9999 fails

Hi,

I have just performed an opam update to get the latest version of eliom and the recompilation of eliom.9999 fails as it does not find js_of_ocaml.tyxml and wikidoc

Regards

Julien

Escaped values, client values and shared section.

Currently, this piece of code will not work :

let a = ...
{shared{
let bla = {{ ... %a ... }}
}}

You need to write it like this :

let a = ...
{shared{
let bla = 
  let a = %a in
  {{ ... %a ... }}
}}

The problem here is that the syntax extension assume that the %a in a client value inside a shared section must point to a shared value. The syntax extension then erase the % when extracting the "client" point of view.

There is several possibility to add the let a = %a automatically in the current syntax but all of them mess with a legit piece of code. The syntax extension is (mostly) local and it's not reasonable to do a global transformation to catch this kind of piece of code.
In order to do this properly, we would need a type directed syntax extension to detect if a come from the server or not.

This seems difficult to tackle for now, but may be easier in the future, with the evolution of compiler libs.

Modules not linked on client side

Very often some modules are missing in client side programs.
The program fails at startup with a message in the console saying that some closure is not found.

We usually solve this manually by adding ad-hoc references to values from each module in main program.

May be we should try to add option -linkall to the command line generated by js_of_eliom? Does it solve the pb?

js file in META?

archive(byte,javascript) = "+eliom.client/eliom_client.js"

So then we can use ocamlfind

Reactive dom

It allows the following on client side:

let signal,set_signal = React.S.create "initial title"
let class, set_class = React.S.create "red"

let mydomstring = Html5.R.node (React.map Html5.D.pcdata signal)

let reagular_dom = h1 ~a:[Html5.R.a_class class] R.[ mydomstring ]

let _ = Lwt_js.sleep 2. >>= fun () ->  set_signal "new title";set_class "blue"

setting signals will update the dom.
I guess one can implem the server side version of it so that server side changes update the client.

standalone commit : https://github.com/besport/eliom/commit/ece68bb4bb99b040be2b5cc848e3bf8a7caf578b

Using a_ontimeupdate attribute raises an Uncaught ReferenceError

Hi,

I'm using the a_ontimeupdate attribute for on the Html5.D.video tag. But during the page loading, this javascript exception raises :

Uncaught ReferenceError: 

caml_closure_idYZ5x5V1X6oZfx8l9tIYSJ4gmAmw41d4d9ece9ab16d3 is not defined 

ontimeupdate

But not all the time. Sometimes it's something like :

Uncaught SyntaxError: Unexpected token ILLEGAL

And sometimes there is no exceptions. But in all of those cases, the event handler works just fine. I don't think the error comes from me because I filled the attributes a_onplay, a_onpause, etc., in the same way and the exception raises only with a_ontimeupdate.

Just to check, I tried with Lwt_js_event.make_event and creating the event from a string with Dom_html.Event.make "timeupdate" and there is no exception at all.

P.S. : my source code repository is here
Please don't blame me for my dirty code, it's just a try.

Entity in client code.

It seems it is not possible to use Html5.{F,D}.entity in client code ; the function works well in server code but maybe produces incorrect HTML when used client-side. I wrote a simple example to illustrate this: https://gist.github.com/pveber/6607134. Normally the page should display a beta and a gamma character, while here only a beta appears. If entity is replaced by pcdata on line 22, the code of the gamma character appears below the beta character.

"Wrong parameters" even with type-safe Eliom_parameter and Html5.F.a

While using the “normal” way of defining services, I got into a wrong argument parsing case.

Starting from a fresh project made with eliom-destillery, and the following modifications:

let main_service =
  Eliom_service.service ~path:[]
    ~get_params:Eliom_parameter.(
      sum 
        (set string "strings")
        (opt (int "left" ** int "right"))
    ) ()

and

let () =
  Test_app.register
    ~service:main_service
    (fun params () ->
      Lwt.return
        (Eliom_tools.F.html
           ~title:"test"
           ~css:[["css";"test.css"]]
           Html5.F.(body [
             h2 [pcdata "Welcome from Eliom's destillery!"];
             a main_service [pcdata "link1"] 
               (Eliom_parameter.Inj1 ["bouh"; "bah"]);
             pcdata ", ";
             a main_service [pcdata "link2"] 
               (Eliom_parameter.Inj2 None);
             pcdata ", ";
             a main_service [pcdata "link3"] 
               (Eliom_parameter.Inj2 (Some (42, 42)));
           ])))

On the generated page the link3 is broken (goes to “Wrong Parameters”).

I'm using Eliom 3.0.3 from Opam (and OCaml 4.01.0).

PGOCaml syntax does not compile

When compiling using eliomc/eliomopt with pgocaml.syntax it produces the following error:

Camlp4: Uncaught exception: DynLoader.Error ("/home/cyocum/.opam/system/lib/pgocaml/pa_pgsql.cma", "error while linking /home/cyocum/.opam/system/lib/pgocaml/pa_pgsql.cma.\nReference to undefined global `Batteries'")

I have the following installed in opam:
batteries 2.1.0 Community-maintained foundation library
eliom 3.0.3 Framework for programming web sites and client/server web applications
pgocaml 1.7.1 Interface to PostgreSQL databases

I also downgraded to batteries 2.0.0 and I still get the same error.

Question about fallback services

The new services typing feature doesn't allow to have a fallback service that don't have the same type than the service himself.

For instance, if you have an Appl service and you want to have an Action (Http) service with this service as fallback, the current constraint will reject this (you can bypass this by using the module Unsafe).
This is also rejected for a Http service with an Appl fallback.

What is the expected semantic of fallbacks ? What about caml services ?

Can we conceder allowing this by using [< non_caml_service ] instead of [< http_service ] and [< appl_service ] ?

Regression on polymorphism for injections

There is a weird regression for the typing on injections in the last few commits, and it's the source of this pull request : ocsigen/eliom-widgets#6
Compiling eliom-widget leads to this error message

File "src/ew_editable.eliom", line 45, characters 34-39:
Syntax error: The type of an injected value must not contain any type variable.
Error while running external preprocessor

This was no the case before. I bisected, 71d633a and e1db963 are good, e7cfcee is bad. All the commit in between (1bdb927 0460699 f76931b 96b7132) don't compile/install, so I can't test.
Furthermore, they touch the build system and I have no idea what is going on there.

@balat : you wrote those commits, can you look at this ?

P.S. also, @balat, please read this. You have no idea how happy that would make me. :3

Error with native code in master: undefined symbol

I've tried a simple "Hello World" server-only Eliom module compiled against the latest Ocsigenserver/Eliom development versions (installed via OPAM using the "opamocsigen" repo. Compiler version is 4.01.0). While it does load and run successfully in the bytecode version, trying to run the native code version with ocsigenserver.opt fails with the following error message:

ocsigenserver.opt: main: Fatal - While loading /home/dario/.opam/4.01.0/lib/eliom/server/eliom.cmxs: error loading shared library: /home/dario/.opam/4.01.0/lib/eliom/server/eliom.cmxs: undefined symbol: camlEliom_content

The module's cmxs file was produced using the usual method:

ocamlopt -shared -linkall -I `pwd` -o module.cmxs module.cmx

Is this a known issue?

Multiple shared section

this piece of code doesn't compile :

{shared{
let a = ...
let b = {{ a }}
}}

but this one does

{shared{
let a = ...
}}
{shared{
let b = {{ a }}
}}

A short-term solution would be to distribute the shared section along top-level declaration, but I'm sure some other bug like this one lie around.

Oasis + Eliom --> Problem to link Javascript

I'm trying to create a template of a website whose compilation is based on Oasis. With the help of some doc and the Cumulus github page (thank you it's really usefull) I made a first version which can display a page. The problem is that the javascript code isn't launch. In fact I don't even know how to say "please add this library to the JS file" in the oasis file.

If you want to test on the same code as me, is the code I use : https://github.com/tobiasBora/eliom_template_oasis_03.

To run it :

  • [Optional] oasis setup
  • ./configure
  • make
  • make run

(This script should copy the js file in the (local) static dir, the problem doesn't come from here.)

And after just open http://localhost:8080/. The basic page is opened, but if you click on "Hello" you are supposed to see an alert message... Which never happened. I have the error
Failure(Client closure 872924384 not found (is the module linked on the client?))

As you can see the library isn't linked to the client.

Could you please explain me how I could link the client part of a library to the JS file with Oasis ?

Please explain the new META

I don't understand it. Now eliom.{server,client} is a syntax extension ? What is eliom.{server,client}.syntax then ?

Find a well integrated way to update some parts of a page

Several use cases for updating elements of a page distinctly exists. In Cumulus for updating either the comment button, the upvote number or even adding a new element or even in xprime (don't know the details).

There is two ways to fix that.
Either maintain elements id on client and look up for update every n seconds.
Or maintain elements id on server side and use Eliom_bus or Eliom_react to update the client.

The second way is how does xprime and it needs complicated things like weak tables of buses and so on.

So I wonder if somebody have ideas of how implement that kind of thing properly with eliom ?

PS: Sorry if I've not described well the issue.

try to fake placeholder when no supported

I don't know if you're interested in merging this hack. We use it to fake placeholder under ie9. It set the input value with the placeholder when needed.

known isssue:
This patch doesn't do anything when trying to send_the_form/get_value. so you'll send/retrieve the value of the placeholder when the input is not set.
One could check for the classname placeholder_class_hack to decide whether to send the empty string or the actual value. This could be done before sending a form or when using Manip.get_value (this function doesn't exist yet)

https://github.com/besport/eliom/commit/27aa578157aa1005ff1c0d17aa1222b28db2e818

DomReact : Wrap tyxml elt with ReactiveList instead of React.S

see https://github.com/hhugo/reactiveData
use case:

module RL =  ReactiveData.RList
let r_data, handle = RLmake []
let r_desc = RL.map (fun data ->
  Printf.sprintf "name: %s ; value: %s" data.name data.value)
  r_data
let r_li = RL.map (fun desc -> li [ pcdata desc]) r_desc
let elt = R.ul r_li

let () =
  (* append data to the reactive list *)
  RL.append handle {name="name1";value="value1"};
  ....
  (* remove data at position i *)
  RL.remove i handle;
  (* swap to elements *)
  RL.swap i j handle
  ....

interface : https://github.com/hhugo/reactiveData/blob/master/src/reactiveData.mli

tools : clean temporary files

at least for eliomdoc

henry@ocsigen-s1:/tmp$ ls -l /tmp/eliomdoc* | wc -l
14947
henry@ocsigen-s1:/tmp$ ls -l /tmp/camlpp* | wc -l
3532

eliom.cmxs do not compile properly

I have the error

ocsigenserver.opt: main: Fatal - While loading /home/vb/.opam/4.01.0/lib/eliom/server/eliom.cmxs: error loading shared library: /home/vb/.opam/4.01.0/lib/eliom/server/eliom.cmxs: undefined symbol: camlEliom_content_core

when trying to compile my application (make test.opt)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.