Skip to content

Commit c8710f2

Browse files
authored
refactor: Move Sprocket JS files to Webpack (Part 1) (#3025)
* refactor: Move Sprocket JS files to Webpack (Part 1) JavaScript for RfCs, Flashes and the color mode can be moved without modifications. Relates to #3021 * kebab case * Move flash messages CSS to app. * Use require avoiding hoisted imports
1 parent fb7df3a commit c8710f2

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

app/assets/javascripts/application.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
//= require rails-timeago
1414
//= require locales/jquery.timeago.de.js
1515
//
16-
// lib/assets
17-
//= require flash
18-
//= require color_mode_picker
19-
//
2016
// app/assets
2117
// --> Include some assets first, as they are used by other assets.
2218
// --> Hence, the order specified here is important.

app/assets/stylesheets/application.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
* files in this directory. Styles in this file should be added after the last require_* statement.
1111
* It is generally better to create a new file per style scope.
1212
*
13-
* lib/assets
14-
*= require flash
15-
*
16-
* app/assets
1713
*= require_tree .
1814
*= require_self
1915
*/
File renamed without changes.

app/javascript/application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,7 @@ window.ace = ace; // Publish ace in global namespace
8888
// Turbo
8989
import '@hotwired/turbo-rails';
9090
import './turbo-migration';
91+
92+
// Import of Rails sprocket assets with minimal changes. After the initial migration these files should
93+
// be moved to an appropriate place after some adjustments to fit modern Rails JS.
94+
require('sprocket-asset-import');
File renamed without changes.
File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require('./flash');
2+
require('./color-mode-picker');
3+
4+
require('./request-for-comments');
File renamed without changes.

0 commit comments

Comments
 (0)