Comments (5)
@gerdstolpmann may have suggestions on this.
from eliom.
The js file should not go into archive - which is reserved for files that are really passed to ocamlc/ocamlopt. You could e.g. use
archive(byte,javascript) = "library_jsofocaml.cma"
to select a special version of a library that is prepared for jsofocaml (say, if you have a library that should work for both the standard runtime and for javascript, and you need different ocaml code depending on the runtime).
I think linkopts looks like the right choice for this. linkopts is nowadays rarely used, but initially this META variable contained additionally parameters for the linker. And this is what you are doing here - you have a special form of linking where extra js file need to be loaded. What I'm suggesting is: Put this into META:
linkopts(javascript) = "library.js"
and use this type of query to get all js files for some packages:
ocamlfind query -o-format -r -predicates "javascript" eliom.client
Note that we use here only "javascript" and not "byte,javascript" as predicates so the standard linker is unaffected by this.
from eliom.
I've been trying the following (in js_of_ocaml META file)
linkopts(javascript) = "runtime.js"
linkopts(javascript,pkg_unix) += "unix.js"
I was expected the command:
ocamlfind query -o-format -r -predicates "javascript" js_of_ocaml unix
to output unix.js
as well. It doesn't .
I may have misunderstund the doc (http://projects.camlcity.org/projects/dl/findlib-1.4/doc/ref-html/r681.html).
I was expecting pkg_unix
to be true.
Is it possible to get this behavior ?
from eliom.
Hmmm, ocamlfind query doesn't do this. This is probably just an oversight, as the other subcommands like ocamlc actually set the pkg_* predicates automatically.
I could add this to the next version of ocamlfind. Ok?
from eliom.
Ok. meanwhile, one can set pkg_* predicates manually
ocamlfind query -r -format "pkg_%p" eliom.client
from eliom.
Related Issues (20)
- [Eliom] Fix syntax extension (optional parameter not working) HOT 3
- [Eliom] Is it possible to use `let%rpc` if the function is used only from client section?
- Replace server_function everywhere (OS template, Eliom manual, tutorials)
- Release new versions
- Remove connected wrappers from BS
- compile with lwt.dev: Fatal error: exception complex open are not supported before OCaml 4.08 HOT 2
- Usage of attached POST action HOT 4
- eliomdep doesn't seem to understand `-map` option HOT 1
- Typing error on Eliom >= 8.9.0 HOT 2
- Unbound constructor HOT 8
- Firefox rejecting cookies over SameSite attribute?
- opam and eliom -> [eliom: make]Killed HOT 1
- Use ocamlformat
- test
- Failure to build with dune cache enabled HOT 1
- Error when running ocsigenserver: The module `B' is not yet initialized HOT 4
- Problem with browser navigation HOT 4
- OCaml 5.2 support HOT 5
- What is the license of eliom-distillery templates ? HOT 2
- Rapid succession of comet-requests when using two Eliom_react.Down channels
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eliom.