-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow Fastboot sandbox globals to be defined. #25
Conversation
Thanks for working on this. But I think it should be possible to solve your problem without needing a feature at this layer. For example, to polyfill
|
@ef4 I thought that was working initially, but it isn't. It looks more like PouchDB(through ember-pouch) is looking for Here's my error summary:
|
I've been working on a simple static blog that uses Prember and PouchDB(ember-pouch). Unfortunately, PouchDB requires the presence of fetch() and Headers in the global scope, making it incompatible with Fastboot out of the box.
I added a
globals
option to Prember so that global variables can be defined for the Fastboot sandbox. That way, for my purposes, fetch and Headers will be available for PouchDB in Node, thereby allowing my application to receive blog entry JSON from my CouchDB database before rendering the HTML. I imagine this option will be useful to others.A test is included, but it's looking for the presence of a string in the DOM passed through the globals option. I couldn't think of a better way to test this feature, which is probably due to my laziness in testing with Ember, and would be open to a suggestion on how to better test the globals option.