Project

General

Profile

Refactor #12364

Use NPM+Webpack to manage external assets (js, css, fonts)

Added by Tomer Brisker almost 5 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Packaging
Target version:

Description

Currently, some assets are manually inserted into `vendor/assets` and not automatically updated, while others are added as gem files which do update automatically but require additional packaging work every time they change.
It would be beneficial to use bower to maintain those assets for the following reasons:
  1. Reduce packaging work.
  2. Allow more frequent updates of included assets, as updates will not require separate repackaging.
  3. Allow simple updates to assets which don't have a gemified version.
  4. Allow timely updates to assets who's gemified versions are not up to date.

Related issues

Related to Foreman - Bug #16046: "Don't know how to build task 'webpack:compile'" running jenkins:integration taskClosed2016-08-10
Related to Foreman - Bug #16074: development version listens on 0.0.0.0:3000 and 0.0.0.0:3808 by defaultClosed2016-08-11
Related to Foreman - Feature #16160: Add shell script to start foreman-webpackClosed2016-08-18
Related to Foreman - Bug #17236: webpack source maps do not workClosed2016-11-06
Related to Discovery - Bug #19403: js error of missing jquery.cookieClosed2017-04-27

Associated revisions

Revision e2a57bfe (diff)
Added by Tomer Brisker almost 4 years ago

Fixes #12364 - Use NPM+Webpack to handle external assets

This commit introduces NPM and Webpack to handle external assets.
It also provides ES6 support and a live reload dev server that can be
used by running `foreman start` instead of `rails start`.
Do not forget to run `npm install` before starting the server.
This commit also contains some code that was created by Ohad Levy
<>

Revision 42ba771c (diff)
Added by Tomer Brisker almost 4 years ago

Refs #12364 - Allow running webpack dev server on any hostname

Currently, SecureHeaders only allows running the webpack dev server from
localhost or 0.0.0.0, and only using http. This leads to issues when
attempting to run foreman inside a virtual machine or using https. This
patch will generate the correct headers during runtime, to allow the dev
server to be run on the same host and protocol as the request uses.

Revision 31bbcd81 (diff)
Added by Tomer Brisker almost 4 years ago

Refs #12364 - Only load the dev server js if it's enabled

Also allow disabling the dev server from the settings file

Revision ab5c7c28 (diff)
Added by Marek Hulán almost 4 years ago

Refs #12364 - webpack server can serve assets on https

History

#1 Updated by Tomer Brisker over 4 years ago

It would seem that bower is no longer being actively developed
So it would seem we should look into other options for handling assets, possibly npm.

#2 Updated by Tomer Brisker about 4 years ago

  • Subject changed from Use bower to maintain external assets (js, css, fonts) to Use NPM+Webpack to manage external assets (js, css, fonts)
  • Status changed from New to Assigned

Changed this to NPM+Webpack following discussion in https://github.com/theforeman/rfcs/pull/3

#3 Updated by The Foreman Bot about 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/3433 added

#4 Updated by Daniel Lobato Garcia about 4 years ago

  • Target version set to 1.7.1

#5 Updated by Daniel Lobato Garcia almost 4 years ago

  • Target version deleted (1.7.1)

#6 Updated by Daniel Lobato Garcia almost 4 years ago

  • Target version set to 1.7.1

#7 Updated by Tomer Brisker almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#8 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 160

#9 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #16046: "Don't know how to build task 'webpack:compile'" running jenkins:integration task added

#10 Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3721 added

#11 Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3722 added

#12 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #16074: development version listens on 0.0.0.0:3000 and 0.0.0.0:3808 by default added

#13 Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3734 added

#14 Updated by Lukas Zapletal almost 4 years ago

  • Related to Feature #16160: Add shell script to start foreman-webpack added

#15 Updated by Daniel Lobato Garcia almost 4 years ago

  • Target version changed from 1.7.1 to 1.6.2

#16 Updated by Daniel Lobato Garcia almost 4 years ago

  • Target version changed from 1.6.2 to 1.7.1

#17 Updated by Ohad Levy over 3 years ago

  • Related to Bug #17236: webpack source maps do not work added

#18 Updated by Ohad Levy over 3 years ago

  • Related to Bug #19403: js error of missing jquery.cookie added

Also available in: Atom PDF