-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install in the Browser #3
Comments
The current code runs just fine in the browser where LevelGraph can run. |
roger! if I figure it on my own, I'll make a PR :) |
Browserify can be used to create amd-compatible modules. You want to Let me know if you need help! |
i tried adding it to project using browserify, regular levelgraph works fine but levelgraph-jsonld gives me browserify error:
fast grep shows some 'canvas' stuff going on in levelgraph->jsonld->jsdom depenency... jsonld.js/js/request.js tries
explaining:
in my case i need jsonld without any support for RDFa! @dlongley i wonder if we can extract something lighter for using as dependency in levelgraph-jsonld ? |
You are right, json-ld.js is not compatible with browserify. If you look at: https://github.com/digitalbazaar/jsonld.js/blob/master/js/jsonld.js#L38-L55, it seems the JSON-LD thinks that it is in node while it isn't. I think something similar will do: browser: {
"jsdom": false
} Looking at the JSON-LD library the RDFa stuff seems out of place, and maybe it should belong to a different library, like jsonld-rdfa.js, but that is out of the scope of this issue. |
I've cc'd @davidlehn on this issue since he has worked on that part of the jsonld.js code (related to RDFa). |
FYI, that "browser" info gist changed locations: https://gist.github.com/defunctzombie/4339901 |
@mcollina i'll push working version to a branch here later today... Error: global leak detected: rval if you could take a look at it then we would heave working version with all tests passing in the browser by the end of the day 😄 |
I don't have time today, I'll check tomorrow. Il martedì 28 gennaio 2014, ☮ elf Pavlik ☮ [email protected] ha
|
ok! i may need to merge #16 before making this pull request because i already rebased browserify work to include it... |
Have you guys tried the "noParse" option with browserify when including jsonld.js? It seems like it would get the job done. If that doesn't work, have you tried ignorify? |
noparse is only from the command line for client-based stuff like jquery, and the main principle behind the browserify/node modules is that they should be 'self-contained'. I do not want to mandate special options for everything to work, it should 'just work'. ignorify is super-old (2 years ago) and it is a web middleware. |
done in #23 |
i would like to experiment with it in: https://github.com/apollo-ng/dspace-client
do you just need to write instructions in README or current code doesn't run in browsers?
steps from levelgraph/levelgraph-n3#2
./build/
The text was updated successfully, but these errors were encountered: