Skip to content

Commit a5f355f

Browse files
committed
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
1 parent d40557c commit a5f355f

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

app/assets/javascripts/application.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@
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.
2319
//
24-
// 1. Some common base functions and monkey patches
25-
//= require base
26-
// 2. Programming groups are required by "channels/synchronized_editor_channel.js"
20+
// 1. Programming groups are required by "channels/synchronized_editor_channel.js"
2721
//= require programming_groups
28-
// 3. The turtle library is required by "editor/turtle.js"
22+
// 2. The turtle library is required by "editor/turtle.js"
2923
//= require turtle
30-
// 4. Some channels are required by "editor/editor.js.erb"
31-
//= require_tree ./channels
32-
// 5. Require the editor components, as needed by "./editor.js" and "./community_solution.js"
24+
// 3. Some channels are required by "editor/editor.js.erb"
25+
// 4. Require the editor components, as needed by "./editor.js" and "./community_solution.js"
3326
//= require_tree ./editor
3427
//
3528
// All remaining assets are loaded in alphabetical order

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 inital migration this
93+
// files should be included in the application after some adjstments to fit modern Rails JS.
94+
import 'sprocket_asset_import'
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import './flash'
2+
import './color_mode_picker'
3+
4+
import './base'
5+
6+
import './request_for_comments'
File renamed without changes.

0 commit comments

Comments
 (0)