Skip to content

Re-implement page-specific JS in a better way.

username-removed-386624 requested to merge js-content-for into master

What does this MR do?

This rebuilds the way we do page-specific JavaScript assets for a few reasons:

  • The current implementation does not work with Subresource Integrity (!4808 (merged))
  • The current implementation doesn't allow caching of libraries because each page we hook up with this system will have a separate application.js. Meaning that for every page that uses Ace Editor, we'd have to load Ace Editor plus any GitLab-specific scripts in the same file, making local caching of just Ace Editor impossible.
  • The current implementation is rather hacky.

Are there points in the code the reviewer needs to double check?

That Sprockets doesn't choke on this when we use precompiled assets.

What are the relevant issue numbers?

#14372 (closed)

Does this MR meet the acceptance criteria?

cc: @jschatz1 @pavelloz

Thanks to @pavelloz for his example implementation which was very useful.

Merge request reports