Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update to CodeMirror 3 and start to ship our components #3232

Merged
merged 26 commits into from
+24,875 −10,318

4 participants

@ellisonbg
Owner

The main purpose of this branch is the update to CodeMirror 3 and ship it as a bower component. Because CodeMirror doesn't use proper semantic version tags, we have created a CodeMirror ipython fork. The sole purpose of this fork is for us to maintain properly named tags that bower can install from.

As a side effect of these changes, we are now shipping in place all bower components that we are using (bootstrap, less. codemirror, jquery). BUT, the version of jquery in components is not yet being used as we are still stuck with the old version attached to the nasty jquery.ui branch we ship. In a later PR, we will need to get rid of that jquery.ui branch (replace those capabilties with bootstrap) and then move to a stable version of jquery.ui that matches that of the jquery component depended upon by bootstrap.

The transition to CodeMirror 3 is a bit of a pain - lots of things broke. In particular the input cell styling, tooltip and completer broke. I think I have fixed it all, but we need to go over these things with a pixel-perfect eye - alignments of all input/output text - subtle padding/margin changes, etc.

This PR replaces PR #2944

ellisonbg added some commits
@ellisonbg ellisonbg Bower has changed component.json to bower.json. Complying. a0cc2fb
@ellisonbg ellisonbg Updating bower.json for our CodeMirror repo. 6339028
@ellisonbg ellisonbg Removing static/components from .gitignore-we want to ship this. 9b11915
@ellisonbg ellisonbg Adding our current components directory.
This commit adds the right versions of:

* Bootstrap
* Jquery
* less.js
* CodeMirror

We should always use bower to manage these packages in the
future. BUT, we are not yet using this version of jquery as
we still rely on an older crazy-branch version of jquery.ui.
647f4b0
@ellisonbg ellisonbg Removing tests from fabfile that are no longer needed. 2571b05
@ellisonbg ellisonbg Moving CodeMirror -> cmtemp dfb847d
@ellisonbg ellisonbg Moving cmtemp -> codemirror. f6bdcd1
@ellisonbg ellisonbg Updating bower.json files. 5590af4
@ellisonbg ellisonbg Updating path to codemirror. 40537f2
@ellisonbg ellisonbg Updating tooltip.js to work with CM3. 4728c84
@ellisonbg ellisonbg In CM3, the class that needs autogrow has changed. f398099
@ellisonbg ellisonbg Updating tooltip.less for CM3 behavior. b978375
@ellisonbg ellisonbg Add components to static URLs. e2e3fd3
@ellisonbg ellisonbg Updating style.min.css. da0782d
@ellisonbg ellisonbg Copying CodeMirror's python mode into place for our ipython mode. 66de4c5
@ellisonbg ellisonbg Updating ipython CM mode. 22418c9
@ellisonbg ellisonbg Fixing typo in ntoebook.html. 688001c
@ellisonbg ellisonbg Changing mode name from python -> ipython. a0c4e41
@ellisonbg ellisonbg Fixing broken URLs to CM assets. 61a613e
@ellisonbg ellisonbg Give the .CodeMirror class no background so ours shows through. 5dafbbd
@ellisonbg ellisonbg Fixing CM3 style related issues.
CM3 introduced a number of changes to how various paddings are set.
Because of how we change the line-height we had to set these back
to the CM2 values. What a pain!
f2bc065
@ellisonbg ellisonbg Removing old codemirror assets - we now use the 1 in components. d077f91
@ellisonbg ellisonbg Fix CM related sizing issues for completer and tooltip. 198b5d5
@ellisonbg ellisonbg referenced this pull request
Closed

CodeMirror 3 #2944

1 of 3 tasks complete
@ellisonbg
Owner

I should note that the move to CM3 fixed some bugs that were preventing us from fixing the dreaded focus-click bug. Yeah!

IPython/frontend/html/notebook/fabfile.py
@@ -7,19 +7,9 @@
static_dir = 'static'
components_dir = os.path.join(static_dir,'components')
-def test_component(name):
- if not os.path.exists(os.path.join(components_dir,name)):
- components()
-
-def components():
- """install components with bower"""
- with lcd(static_dir):
- local('bower install')
@minrk Owner
minrk added a note

why remove the components command? Won't we still want to use this when we update the versions we use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@minrk
Owner

Since the diff is completely impenetrable and filled with irrelevant (to us) removals and additions, I guess the only way to 'review' this is to test it in actual use. Actual code review does not seem possible.

@epifanio

i don't know if my problem is related to this, but after i merged the CM3 branch i'm having trouble to get the "custom js buttons" in the toolbar. this are my files :

this are my files https://gist.github.com/epifanio/5477637

  • reverting to master i got the custom js back
@ellisonbg
Owner
@minrk
Owner

Just following up from IRC: this PR did not actually have any effect on the custom js mentioned above.

@epifanio

sorry for the noise ... was a path mismatch on my system, between different version of ipython
it works fine, js extension loaded correctly and the focus-click bug is no more here :)

@ellisonbg
Owner
@minrk
Owner

jquery is not listed in the dependencies in bower.json

@ellisonbg ellisonbg referenced this pull request
Merged

Remove the unused print notebook view #3235

2 of 2 tasks complete
@ellisonbg
Owner

OK I have made all of the changes I know about: adding back the components fab function and added a README.md for notebook development.

@minrk minrk merged commit 60a66d4 into ipython:master
@Carreau
Owner

Hum... lots of changes in 2 weeks, I would have preferred to be able to pitch in earlier.

I'll will re-do a suggestion I made earlier, which is to consider alternative to bower, which unlike bower allow to specify a tag or even a sha of a repository in the equivalent of component.json

Maintaining our own tagged codemirror branch totally goes against the point of have semantic version number and being able to specify any kind of version range. Also with this, if packager want to use another version, it is as difficult to install another version with bower than to close from the originial repository.

Unless I'm missing something..

@minrk
Owner

We are not maintaining our own codemirror repo anymore, since we realized that bower cannot be used for everything

@ellisonbg
Owner
@ellisonbg
Owner
@minrk
Owner

Since we have proven that bower cannot install everything (CodeMirror, highlight.js, pagedown, prettify, etc.), that repo has two separate installation mechanisms - bower.json and nonbower.json, which is handled identically, but manually, for packages bower cannot install. Since we know that we cannot use bower for everything, I don't see a good reason to add our own repos for the ones that bower can't handle. That would mean we are maintaining our own repo as a submodule to track an installed clone of our own repo that is itself not even our own code, just for a stupid tag.

@Carreau

Hey @ellisonbg,

This seem to break the linenumber that are now out of CM gutter. according to CM docs :

CodeMirror-lines
The visible lines. This is where you specify vertical padding for the editor content.

So was it really what you ment ? could we at least keep a padding-left/right : 4px ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 28, 2013
  1. @ellisonbg
  2. @ellisonbg
  3. @ellisonbg
  4. @ellisonbg

    Adding our current components directory.

    ellisonbg authored
    This commit adds the right versions of:
    
    * Bootstrap
    * Jquery
    * less.js
    * CodeMirror
    
    We should always use bower to manage these packages in the
    future. BUT, we are not yet using this version of jquery as
    we still rely on an older crazy-branch version of jquery.ui.
  5. @ellisonbg
  6. @ellisonbg

    Moving CodeMirror -> cmtemp

    ellisonbg authored
  7. @ellisonbg

    Moving cmtemp -> codemirror.

    ellisonbg authored
  8. @ellisonbg

    Updating bower.json files.

    ellisonbg authored
  9. @ellisonbg

    Updating path to codemirror.

    ellisonbg authored
  10. @ellisonbg
  11. @ellisonbg
  12. @ellisonbg
  13. @ellisonbg
  14. @ellisonbg

    Updating style.min.css.

    ellisonbg authored
  15. @ellisonbg
  16. @ellisonbg

    Updating ipython CM mode.

    ellisonbg authored
  17. @ellisonbg
  18. @ellisonbg
  19. @ellisonbg
  20. @ellisonbg
  21. @ellisonbg

    Fixing CM3 style related issues.

    ellisonbg authored
    CM3 introduced a number of changes to how various paddings are set.
    Because of how we change the line-height we had to set these back
    to the CM2 values. What a pain!
  22. @ellisonbg
  23. @ellisonbg
Commits on Apr 29, 2013
  1. @ellisonbg
  2. @ellisonbg
  3. @ellisonbg
Something went wrong with that request. Please try again.