Specify the order of JavaScript assets loaded.
Previously, we could face (a rare) race condition with the wrong order. This was caused by Turbolinks and our usage of "components" (e.g., the CodeOceanEditor). It could happen that Turbolinks fired the `turbolinks:load` event, as all XHR requests finished. In the event handler, we sometimes referred to other components. However, those components weren't initialized yet, potentially. This is due to Sprockets concatenating files in alphabetical order, ignoring our component dependencies. With this commit, we try to specify the required order and thus aim to implement a permanent fix. Fixes CODEOCEAN-FRONTEND-7W Fixes CODEOCEAN-FRONTEND-7D
This commit is contained in:

committed by
Sebastian Serth

parent
65416934ea
commit
619291c647
@ -19,4 +19,19 @@
|
|||||||
//= require color_mode_picker
|
//= require color_mode_picker
|
||||||
//
|
//
|
||||||
// app/assets
|
// app/assets
|
||||||
|
// --> Include some assets first, as they are used by other assets.
|
||||||
|
// --> Hence, the order specified here is important.
|
||||||
|
//
|
||||||
|
// 1. Some common base functions and monkey patches
|
||||||
|
//= require base
|
||||||
|
// 2. Programming groups are required by "channels/synchronized_editor_channel.js"
|
||||||
|
//= require programming_groups
|
||||||
|
// 3. The turtle library is required by "editor/turtle.js"
|
||||||
|
//= require turtle
|
||||||
|
// 4. Some channels are required by "editor/editor.js.erb"
|
||||||
|
//= require_tree ./channels
|
||||||
|
// 5. Require the editor components, as needed by "./editor.js" and "./community_solution.js"
|
||||||
|
//= require_tree ./editor
|
||||||
|
//
|
||||||
|
// All remaining assets are loaded in alphabetical order
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
Reference in New Issue
Block a user