Skip to content

Conversation

arikfr
Copy link
Member

@arikfr arikfr commented Feb 7, 2018

Some changes to the way we serve assets:

  • All assets served from /static/.
  • All assets go through Webpack (in one way or another).
  • Template helper for Flask to load assets using Webpack's manifest file (copied from Zeus).

Breaking change: REDASH_STATIC_ASSETS_PATH is a single value again and no longer supports multiple paths.

Might help with #2209.

… make sure all assets URLs are prefixed with /static/ and remove our custom assets serving handler.
@arikfr arikfr added this to the v4 milestone Feb 7, 2018
@arikfr arikfr requested a review from kravets-levko February 7, 2018 14:55
new CopyWebpackPlugin([
{ from: 'client/app/assets/robots.txt' },
{ from: 'client/app/assets/css/login.css', to: 'styles/login.css' },
{ from: 'client/app/assets/js/jquery.min.js', to: 'js/jquery.min.js' },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need to store jquery.min.js in app/assets folder? We already have jquery and all pre-built bundles in node_modules

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not. But then we need to create a new entry point that will export only jQuery?

Copy link
Collaborator

@kravets-levko kravets-levko Feb 7, 2018

Choose a reason for hiding this comment

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

Can you try to replace from path with node_modules/jquery/dist/jquery.min.js? Will it work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Brilliant. Done 👍 96ad3aa

Copy link
Collaborator

@kravets-levko kravets-levko left a comment

Choose a reason for hiding this comment

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

I tried to review back-end code too, but since I'm not familiar with it - I may miss something. But in general everything looks good.

P.S. It's cool that you finally removed old css files from client/app/assets/css 👍

@arikfr
Copy link
Member Author

arikfr commented Feb 8, 2018

Thanks!

P.S. It's cool that you finally removed old css files from client/app/assets/css 👍

It's been long overdue. Next thing can be to create a dedicated login page CSS, but maybe it's better to load the large one to save download time on the next page?

@arikfr arikfr merged commit 07d8bab into master Feb 8, 2018
@arikfr arikfr deleted the webpack branch February 8, 2018 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants