Using the minified version without CDN doesn't work if not re-downloaded afterwards

Created on 4 March 2023, almost 2 years ago

Problem/Motivation

Uncaught ReferenceError: CodeMirror is not defined

Steps to reproduce

  1. Install codemirror
  2. Uncheck "Load the library from CDN"
  3. Have "Use minified version of the library unchecked" (the same issue exists vice-versa)
  4. Run drush codemirror:download
  5. See only the non-minified files being downloaded:
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/lib/codemirror.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/edit/closetag.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/fold/foldcode.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/fold/foldgutter.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/fold/brace-fold.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/fold/xml-fold.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/fold/comment-fold.js [200 O                                                                                                                     K]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/display/autorefresh.js [200                                                                                                                      OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/display/fullscreen.js [200                                                                                                                      OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/display/placeholder.js [200                                                                                                                      OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/mode/overlay.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/comment/comment.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/selection/active-line.js [2                                                                                                                     00 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/clike/clike.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/css/css.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/htmlmixed/htmlmixed.js [200                                                                                                                      OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/xml/xml.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/javascript/javascript.js [20                                                                                                                     0 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/markdown/markdown.js [200 OK                                                                                                                     ]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/php/php.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/sql/sql.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/twig/twig.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/mode/yaml/yaml.js [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/lib/codemirror.css [200 OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/fold/foldgutter.css [200 OK                                                                                                                     ]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/addon/display/fullscreen.css [200                                                                                                                      OK]
    https://cdn.jsdelivr.net/npm/codemirror@5.51.0/theme/darcula.css [200 OK]
  6. Try CodeMirror and see it works and loads as expected
  7. Enable "Use minified version of the library"
  8. Try Codemirror and see it's broken and doesn't load as expected, as the minified assets are missing!

Workaround:
Run drush codemirror:download again and see the minified libraries being downloaded

Expected behavior

Being able to simply switch in the UI like for all other typical third party library modules.

Proposed resolution

Simply download both, the minified and unminified assets, when running drush codemirror:download. It won't do any harm ;)

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024