- From: <henry.story@bblfish.net>
- Date: Wed, 2 Jul 2014 15:10:10 +0200
- To: Ruben Verborgh <ruben.verborgh@ugent.be>
- Cc: public-rdfjs@w3.org
On 30 Jun 2014, at 11:27, Ruben Verborgh <ruben.verborgh@ugent.be> wrote: > Hi Henry, > >> I want to make a port of banana-rdf's plantain implementation ( pure scala ) [1] to scala-js [1]. > > Great news! > >> What is the best JS URL class that can do relative URL >> resolution, normalise urls etc for use in the browser? > > I recently saw https://github.com/Acubed/node-iri pass by on this list; > however, I think that Node's url module does what you need: > http://nodejs.org/api/url.html. > > Since you are looking for browser solutions, > you might want to look at the browserified version of these libraries. > (https://github.com/substack/node-browserify) > In particular, the code for Node's module is here: > https://github.com/joyent/node/blob/master/lib/url.js Thanks. I tried a very initial mapping to scalajs of nodes' Uri class and put the code up on github here: https://github.com/bblfish/node.scalajs The main file is just this: https://github.com/bblfish/node.scalajs/blob/master/src/main/scala/node/scalajs/Url/Url.scala As you can see this is really just adding type annotations to JavaScript. Once that done, one can then use the JS code in Scala without any efficiency loss. In short ScalaJS is just JS with a typesafe type system. This helps a lot as soon as you don't have complete overview of the libraries you are using ( and so on the whole with library development ). Ok, I'll see if this helps me build a banana-rdf pure scala-js implementation of an the base RDF Classes. Henry > > Best, > > Ruben Social Web Architect http://bblfish.net/
Received on Wednesday, 2 July 2014 13:18:40 UTC