-
Notifications
You must be signed in to change notification settings - Fork 605
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
[WIP] FastBoot compatibility #819
Conversation
app/controllers/application.js
Outdated
this.setProperties({ | ||
'flashError': this.get('nextFlashError'), | ||
'nextFlashError': null | ||
}); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; | ||
}), |
There was a problem hiding this comment.
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
app/routes/logout.js
Outdated
activate() { | ||
Ember.$.getJSON('/logout', () => { | ||
fetch(`${this.get('appURL')}/logout`, () => { |
There was a problem hiding this comment.
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
config/environment.js
Outdated
}, | ||
|
||
fastboot: { | ||
hostWhitelist: ['crates.io', /^localhost:\d+$/] |
There was a problem hiding this comment.
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?
app/mixins/fastboot-utils.js
Outdated
* 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. | ||
* */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
app/controllers/me/index.js
Outdated
@@ -1,20 +1,20 @@ | |||
import Ember from 'ember'; | |||
import ajax from 'ic-ajax'; | |||
|
|||
const { inject: { service } } = Ember; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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 😉
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. |
Pages: