Skip to content

Fast Boot "Shoebox": A means to serialize application state into DOM for consumption by the browser - #192

Merged
tomdale merged 1 commit into
ember-fastboot:masterfrom
habdelra:serialize-state
May 17, 2016
Merged

Fast Boot "Shoebox": A means to serialize application state into DOM for consumption by the browser#192
tomdale merged 1 commit into
ember-fastboot:masterfrom
habdelra:serialize-state

Conversation

@habdelra

@habdelra habdelra commented May 11, 2016

Copy link
Copy Markdown
Contributor

This PR is to serialize and deserialize application state, so that application state can be passed between the fastboot rendered app and the browser rendered app.

Todo:

In my local environment with all the npm link's setup amongst all these dependent libs, all the tests are green. So fingers crossed that after all the dependencies above are completed the tests will be green.

Do note, that in order to test retrieving items from the "shoebox", we need to actually run browser tests (not to be confused with the existing mocha server tests). To that end, I had to add a bunch of ember addon boilerplate (created from ember addon) in order to establish the normal ember test qunit browser tests--so that's why all the new files...

@habdelra habdelra changed the title Serialize/deserialize application state Fast Boot "Shoebox": A means to serialize application state into DOM for consumption by the browser May 14, 2016
@habdelra

Copy link
Copy Markdown
Contributor Author

@tomdale ok I'm ready for your 👀 now

Comment thread tests/dummy/app/index.html Outdated

{{content-for "body-footer"}}

<script type="fastboot/shoebox" data-key="key1">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using id instead of data attributes will likely be faster

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

@habdelra

Copy link
Copy Markdown
Contributor Author

@danmcclain I've updated with your suggestions. thanks!

@habdelra
habdelra force-pushed the serialize-state branch 3 times, most recently from fd3a370 to 3458a0c Compare May 14, 2016 18:32
Comment thread app/services/fastboot.js Outdated
Ember.assert('shoebox.put is only invoked from the fastboot rendered application', Ember.get(this, 'fastboot.isFastBoot'));
Ember.assert('the provided key is a string', typeof key === 'string');

let fastbootInfo = Ember.get(this, 'fastboot')._fastbootInfo;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have get available

@tomdale

tomdale commented May 16, 2016

Copy link
Copy Markdown
Contributor

This needs docs (at least API and probably guides on the FastBoot site) before we can merge.

@habdelra
habdelra force-pushed the serialize-state branch 2 times, most recently from d2e0909 to 1c9737b Compare May 16, 2016 17:50
@tomdale
tomdale merged commit 44c79cf into ember-fastboot:master May 17, 2016
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

Successfully merging this pull request may close these issues.

3 participants