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

[WIP] FastBoot compatibility #819

Closed
wants to merge 16 commits into from
Closed

[WIP] FastBoot compatibility #819

wants to merge 16 commits into from

Conversation

sivakumar-kailasam
Copy link
Contributor

@sivakumar-kailasam sivakumar-kailasam commented Jun 27, 2017

Pages:

  • Index
  • Install
  • Logout
  • keywords
  • individual keyword
  • Individual Crate
  • search
  • Login
  • User

@sivakumar-kailasam sivakumar-kailasam changed the title Index page is now FastBoot compatible [WIP] : Index page is now FastBoot compatible Jun 27, 2017
@sivakumar-kailasam sivakumar-kailasam changed the title [WIP] : Index page is now FastBoot compatible WIP | FastBoot compatibility Jun 27, 2017
@sivakumar-kailasam sivakumar-kailasam changed the title WIP | FastBoot compatibility [WIP] FastBoot compatibility Jun 27, 2017
this.setProperties({
'flashError': this.get('nextFlashError'),
'nextFlashError': null
});
Copy link
Member

Choose a reason for hiding this comment

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

how is that related to fastboot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related. I just grouped couple of individual set calls. Should've probably kept in a different commit.

url = `${protocol}://${host}`;
}
return url;
}),
Copy link
Member

Choose a reason for hiding this comment

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

comment here might be valuable to understand why we need this

activate() {
Ember.$.getJSON('/logout', () => {
fetch(`${this.get('appURL')}/logout`, () => {
Copy link
Member

Choose a reason for hiding this comment

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

should probably use ajax() for consistency for now

},

fastboot: {
hostWhitelist: ['crates.io', /^localhost:\d+$/]
Copy link
Member

Choose a reason for hiding this comment

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

can we add localhost only in dev mode?

* during Server Side Rendering(SSR) via FastBoot,
* the JS Fetch API doesn't work with absolute urls.
* This property gives the URL prefix for those network calls.
* */
Copy link
Member

Choose a reason for hiding this comment

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

isn't it the other way around? it doesn't work with relative URLs, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

danngit, you're right. I don't think we need it anymore if I use ajax service.

@@ -1,20 +1,20 @@
import Ember from 'ember';
import ajax from 'ic-ajax';

const { inject: { service } } = Ember;
Copy link
Member

Choose a reason for hiding this comment

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

this will make it harder for the new modules codemod to transform it into an import from @ember/service... I'd rather just keep using the globals for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh so that's why you've used full form everywhere. Got it!

Copy link
Member

Choose a reason for hiding this comment

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

yep, and I don't multi-level destructuring that much 😉

@Turbo87 Turbo87 mentioned this pull request Sep 13, 2017
@sivakumar-kailasam
Copy link
Contributor Author

Closing this PR in favor of smaller PRs to get this repo to be fastboot compatible and then land one PR with the fastboot specific changes.

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.

4 participants