Skip to content

Instantly share code, notes, and snippets.

@kratiahuja
Last active November 12, 2016 00:56
Show Gist options
  • Save kratiahuja/e8f7c80a49deebc86a6b7130ef6d4764 to your computer and use it in GitHub Desktop.
Save kratiahuja/e8f7c80a49deebc86a6b7130ef6d4764 to your computer and use it in GitHub Desktop.
How to run an Fastboot addon with faster fastboot builds

Background

Fastboot 1.0 release is blocked on bad build performance and serving fastboot assets inconsistently. We want to fix this by changing the way fastboot builds its assets. Instead of creating seperate assets we want to create additive assets. This issue in ember-cli perfectly defines what we want to do.

This gist describes the work on how to unblock Fastboot 1.0 and how to run those PRs so that you can play with it.

Things to be done in ember-cli

WIP PRs/RFCs for Fastboot 1.0 release

Things needed to be done in ember-cli

Short term and Long Term RFCs

  • Short Term RFC corresponding to the ember-cli work needed to unblock FastBoot 1.0 is here. This needs immediate attention to unblock Fastboot 1.0.
  • Long Term RFC that makes this generic that any platform can be built is here. This does not need immediate attention. This is a long term goal.

PR

  • Building Fastboot assets into ember-cli: PR. This PR needs immediate attention to unblock Fastboot 1.0.

TODO:

  • We still to fix this issue. It basically means we need to expose an API from ember-cli and/or broccoli-middleware

Things needed to be done in FastBoot land:

PRs

  • Changing the fastboot addon in preparation to Fastboot 1.0 release: PR
  • Changing the fastboot lib in preparation to Fastboot 1.0 release: PR

How do I run all of these changes before they are pushed upstream?

This section describes the various npm links you need to do to run ember build to create the fastboot assets and run ember fastboot --serve-assets to serve the files.

Note: ember fastboot will be killed eventually once this issue is fixed. I plan on working on that next week.

Steps to run ember fastboot --serve-assets:

  1. You need a fastboot dummy app to run this. Currently only ember-cli-fastboot addon works with this. Other OSS addons need to be re-worked (the browser initializers need to be worked correctly).

  2. Create a folder in your workspace where you will download all the repos: mkdir fastboot-run

  3. cd fastboot-run

  4. Download the dummy fastboot addon: git clone https://github.com/kratiahuja/fastboot-build-spike.git

  5. Download the ember-cli branch containing the ember-cli changes:

    a. git clone https://github.com/kratiahuja/ember-cli.git

    b. git checkout add-fastboot

  6. Download the ember-cli-fastboot branch containing the fastboot changes:

    a. git clone https://github.com/kratiahuja/ember-cli-fastboot.git

    b. git checkout build-refactor

  7. Download the fastboot branch:

    a. git clone https://github.com/kratiahuja/fastboot.git

    b. git checkout fastboot-refactor-for-ember-cli

  8. Download the fastboot-express-middleware repo

    a. git clone https://github.com/ember-fastboot/fastboot-express-middleware.git

  9. Run npm install and bower install in all the above repos

  10. cd ../fastboot-express-middleware

  11. npm link ../fastboot

  12. cd ../ember-cli-fastboot

  13. npm link ../fastboot-express-middleware

  14. cd ../fastboot-build-spike

  15. npm link ../ember-cli-fastboot

  16. npm link ../ember-cli

  17. rm -rf dist/ tmp/

  18. ember fastboot --serve-assets

  19. curl http://localhost:3000/foo

  20. Your rendered index.html will contain <p>Hello World!</p> which means fastboot is rendering the app on server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment