Skip to content

Remove more Bootstrap from the main bundle

Mark Florian requested to merge less-bootstrap into master

What does this MR do and why?

This removes more of Bootstrap JS from our main bundle, resulting in a 2.3% drop in size 🎉

Modal

Instantiation methods

Regular expressions

Button

Instantiation methods

Regular expressions

  • rg "toggle\b\W{1,7}\bbutton" {ee/,}app finds things which include "toggle-button" which aren't relevant.
  • rg "bs\.button" {ee/,}app finds nothing.
  • rg "\.button\(" {ee/,}app finds nothing.

Alert

Instantiation methods

Regular expressions

  • rg "dismiss\b\W{1,7}\alert" {ee/,}app finds things which include "toggle-button" which aren't relevant.
  • rg "bs\.alert" {ee/,}app finds nothing.
  • rg "\.alert\(" {ee/,}app finds one false positive.

Collapse

Instantiation methods

Regular expressions

Screenshots or screen recordings

Avatar cropping:

simplescreenrecorder-2023-03-21_12.29.36

Avatar cropping error handling:

simplescreenrecorder-2023-03-21_12.12.56

KaTeX alert dismissal:

simplescreenrecorder-2023-03-21_13.23.58

How to set up and validate locally

Avatar cropping

  1. Visit the Edit Profile page
  2. Choose a new avatar
  3. Observe modal appears
  4. Observe saving the cropped image works

KaTeX rendering alert

  1. Apply this patch:
    diff --git a/app/assets/javascripts/behaviors/markdown/render_math.js b/app/assets/javascripts/behaviors/markdown/render_math.js
    index b2348cf0bad6..040fd202ddfd 100644
    --- a/app/assets/javascripts/behaviors/markdown/render_math.js
    +++ b/app/assets/javascripts/behaviors/markdown/render_math.js
    @@ -14,7 +14,7 @@ import { unrestrictedPages } from './constants';
     const MAX_MATH_CHARS = 1000;
     const MAX_MACRO_EXPANSIONS = 1000;
     const MAX_USER_SPECIFIED_EMS = 20;
    -const MAX_RENDER_TIME_MS = 2000;
    +const MAX_RENDER_TIME_MS = 0;
     
     // Wait for the browser to reflow the layout. Reflowing SVG takes time.
     // This has to wrap the inner function, otherwise IE/Edge throw "invalid calling object".
    
  2. Copy this KaTeX into a comment in an issue (for example).
  3. Observe alert behaviour is intact.
  4. Ignore <copy-code> element appearing over alert close button; it's an existing bug.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mark Florian

Merge request reports