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

Assets need deploy-time building #173

Open
jace opened this issue Nov 14, 2017 · 4 comments
Open

Assets need deploy-time building #173

jace opened this issue Nov 14, 2017 · 4 comments
Assignees

Comments

@jace
Copy link
Member

jace commented Nov 14, 2017

Baseframe makes extensive use of WebAssets, forcing it on all apps. WebAssets is currently configured to build assets on demand at run-time. This interferes with read-only filesystems such as in Docker.

We need WebAssets to do asset building as a distinct step as part of the deployment, or replace it with something else that can do that, like Webpack.

@jace
Copy link
Member Author

jace commented Nov 14, 2017

WebAssets has a note on how to make it work with read-only filesystems. We could add this as a command to manage.py in Coaster. https://webassets.readthedocs.io/en/latest/faq.html#is-google-app-engine-supported

@jace
Copy link
Member Author

jace commented Nov 14, 2017

The notes on URL expiry and cache manifests are also relevant: https://webassets.readthedocs.io/en/latest/expiring.html

@shreyas-satish
Copy link
Contributor

From my reading, here are some features webpack offers over webassets:

  1. Hot Module Replacement
  2. Code splitting
  3. Source maps for JS

There's a plugin that helps retrieve the latest built assets with a jinja helper - https://github.com/nickjj/flask-webpack. I'm currently learning how to configure this and webpack with a flask app.

@jace
Copy link
Member Author

jace commented Nov 15, 2017

Should we provide a two-part upgrade path for existing apps?

  1. Switch to webassets with static compilation via manage.py for all existing apps; no code change necessary in apps.
  2. Allow replacing webassets with webpack for apps that are JS-heavy.

This is assuming webpack is not a drop-in replacement and apps will need upgrades. If that's not the case, we can switch entirely.

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

No branches or pull requests

2 participants