Skip to content
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

[super] Ability to load your own functions #136

Open
rufuspollock opened this issue Jul 2, 2013 · 2 comments
Open

[super] Ability to load your own functions #136

rufuspollock opened this issue Jul 2, 2013 · 2 comments

Comments

@rufuspollock
Copy link
Contributor

Should be able to specify new script libraries you can load.

This would address (or support) a lot of other issues including #68 (geocode scripting functions) and be a massive feature ...

@rufuspollock
Copy link
Contributor Author

I'm wondering if we could take inspiration from @maxogden's https://github.com/maxogden/requirebin plus browserify generally. As I understand requirebin it uses https://github.com/maxogden/browser-module-sandbox to run the actual user script. That in turn works roughly like this:

  • Take the script and extract required modules using detective

  • Use browserify-cdn to grab all of those modules and then call downloadedModules (if not already cached)

    request({method: "POST", body: body, url: self.cdn + '/multi', json: true}, downloadedModules)
    
  • downloadedModules does some caching and then builds the iframe

Questions I have:

  • Can you use browserify stuff in a web worker (I think so)
  • How do we auto-insert the deps into the web worker at run time? (Or we could just dump the entire script code into the web worker and eval along with everything else!)

@rufuspollock
Copy link
Contributor Author

@maxogden re previous comment - any idea on the last set of questions? In particular, I take it one can do on the fly browserify-ication in the browser (and hence potentially in a web worker ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant