-
Notifications
You must be signed in to change notification settings - Fork 311
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
[incomplete] Browser support #105
[incomplete] Browser support #105
Conversation
This causes some tests to time out instead of kill seneca. the [process shim](https://www.npmjs.com/package/process) only exists to provide the nextTick method. the ultimate reason is still rjrodger/use-plugin#4
all of these tests are broken by this issue in use-plugin: rjrodger/use-plugin#4 once a viable fix is available, they should be enabled one-by-one and tested again.
The browser environment requires global functions be called with null as their context.
can you share your motivation for running seneca in the browser? |
@juliangruber just an experiment to see if it is possible :) |
daydreaming would it be possible to use seneca with web-workers? The web workers API is in strings, and seneca communicates through JSON... maybe even hook in to local storage for data entities? I'm not sure it needs to be within this project, but I like the abstractions seneca provides, and would like something nicer than web workers. Maybe we can just make that seneca-the-younger ;) |
closing as won't fix. |
I took a stab at getting seneca to run in the browser, by using browserify to generate a standalone package in UMD format that can be used either directly in the browser, or by require.js or browserify itself. It is automatically generated on publishing to npm, and running npm install. You can then just add a script for the seneca.browser.js file.
The process I followed was to use zuul to run the mocha tests in the browser environment, and make the changes to get as many of them running. You can run
npm run-script test-browser
, and go tohttp://localhost:8080/__zuul
to run them yourself.More information is available in each of the commits, but the big roadblock in all of this is that use-plugin is really incompatible with the browser. Most of the functionality of seneca drives through that module, so anything that does seneca.act or seneca.use is broken until it's rewritten.