Closed Bug 1301790 Opened 8 years ago Closed 8 years ago

Bundle codemirror into a single script

Categories

(DevTools :: Source Editor, defect, P1)

defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Iteration:
51.3 - Sep 19
Tracking Status
firefox51 --- fixed

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

(Whiteboard: [reserve-html])

Attachments

(1 file)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1292592#c44.  Specifically:

"I think before landing that we'll need to also figure out a solution for bundling all of the codemirror scripts into a single script so we don't need to keep that big list in sync in 2 places.  I think the relative require paths inside the CM folder are not correct right now, but we could get that fixed"

Opening this bug to do that
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Flags: qe-verify?
Whiteboard: [reserve-html]
Comment on attachment 8789937 [details]
Bug 1301790 - Bundle codemirror into a single script;

https://reviewboard.mozilla.org/r/77968/#review76468

::: devtools/client/jar.mn:34
(Diff revision 2)
> -    content/sourceeditor/codemirror/addon/fold/foldcode.js (sourceeditor/codemirror/addon/fold/foldcode.js)
> -    content/sourceeditor/codemirror/addon/fold/brace-fold.js (sourceeditor/codemirror/addon/fold/brace-fold.js)
> -    content/sourceeditor/codemirror/addon/fold/comment-fold.js (sourceeditor/codemirror/addon/fold/comment-fold.js)
> -    content/sourceeditor/codemirror/addon/fold/xml-fold.js (sourceeditor/codemirror/addon/fold/xml-fold.js)
> -    content/sourceeditor/codemirror/addon/fold/foldgutter.js (sourceeditor/codemirror/addon/fold/foldgutter.js)
>      content/sourceeditor/codemirror/addon/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js)

Was there a particular reason for excluding tern.js and show-hint.js from the bundle?
Comment on attachment 8789937 [details]
Bug 1301790 - Bundle codemirror into a single script;

https://reviewboard.mozilla.org/r/77968/#review76470
Attachment #8789937 - Flags: review?(gl) → review+
(In reply to Gabriel Luong [:gl] (ΦωΦ) from comment #3)
> Comment on attachment 8789937 [details]
> Bug 1301790 - Bundle codemirror into a single script;
> 
> https://reviewboard.mozilla.org/r/77968/#review76468
> 
> ::: devtools/client/jar.mn:34
> (Diff revision 2)
> > -    content/sourceeditor/codemirror/addon/fold/foldcode.js (sourceeditor/codemirror/addon/fold/foldcode.js)
> > -    content/sourceeditor/codemirror/addon/fold/brace-fold.js (sourceeditor/codemirror/addon/fold/brace-fold.js)
> > -    content/sourceeditor/codemirror/addon/fold/comment-fold.js (sourceeditor/codemirror/addon/fold/comment-fold.js)
> > -    content/sourceeditor/codemirror/addon/fold/xml-fold.js (sourceeditor/codemirror/addon/fold/xml-fold.js)
> > -    content/sourceeditor/codemirror/addon/fold/foldgutter.js (sourceeditor/codemirror/addon/fold/foldgutter.js)
> >      content/sourceeditor/codemirror/addon/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js)
> 
> Was there a particular reason for excluding tern.js and show-hint.js from
> the bundle?

They are used directly by the autocomplete module: https://dxr.mozilla.org/mozilla-central/source/devtools/client/sourceeditor/autocomplete.js#12.  And TernServer wasn't getting added onto the CodeMirror object when they were bundled.  It's probably possible to get this to this work but makes sense as a follow up I think.
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/8d2a514d0f23
Bundle codemirror into a single script;r=gl
Comment on attachment 8789937 [details]
Bug 1301790 - Bundle codemirror into a single script;

https://reviewboard.mozilla.org/r/77968/#review76512

::: devtools/client/.babelrc:1
(Diff revision 3)
> + { "presets": [ "es2015" ] }

this could be done in package.json without add .babelrc, like 

```
babel: {
  "presets": [ "es2015" ]
}
```
https://hg.mozilla.org/mozilla-central/rev/8d2a514d0f23
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Iteration: --- → 51.3 - Sep 19
Flags: qe-verify? → qe-verify-
Priority: P3 → P1
Depends on: 1304262
Blocks: 1304262
No longer depends on: 1304262
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.