8000 Organize the JS and less files by component. by ellisonbg · Pull Request #3325 · ipython/ipython · GitHub
[go: up one dir, main page]

Skip to content

Organize the JS and less files by component. #3325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
May 24, 2013
Merged

Conversation

ellisonbg
Copy link
Member

This PR does the client side re-org that parallels the server side work in #3321. I have created subdirectories in static for each part of the client. Roughly speaking there is one subdir for each page, web service or component.

Todo:

  • Override bootstraps styling of the code and pre elements so it doesn't conflict with that of CodeMirror
  • Figure out how custom.js and custom.css should work. The top level js and css directories they were in are now gone.
  • Update the fabfile.py to build all of the different style.min.css for each page.
  • Test, test, test. ( tester, look at the new pager)
  • Get the favicon working again.

@minrk
Copy link
Member
minrk commented May 16, 2013

Is there really any reason to have a separate style for each component? Wouldn't that be significantly less efficient than a single style.min.css that's slightly larger, but only needs to be downloaded / cached once?

@minrk
Copy link
Member
minrk commented May 16, 2013

the vast majority of CSS is shared, so if we minify to separate style.min.css, we are essentially multiplying the amount of traffic / requests involved in fetching CSS by the number of pages, which is the opposite of the goal.

@Carreau
Copy link
Member
Carreau commented May 16, 2013

Agree with the 2 comments of @minrk .
we can have a per-directory this-component-style.less that define per-componenent local style, but it seem that
bundeling up everything in one file make more sens.

@Carreau
Copy link
Member
Carreau commented May 16, 2013

Also, this can be part of another PR, but could the login form be pure JS.
So you can actually catch a 403 and just prompt to re-login on the same page ?
Bonus point if we figure out a way to do it that also works with emacs client among other.

I have to re-dive into notebook-list and cluster-list, but something along the same would be great, to for example have a quick access list in the notebook file-open menu.

@minrk
Copy link
Member
minrk commented May 17, 2013

IPython.core.tests.test_display.test_image_filename_defaults uses the ipynb logo image, and needs to be updated for the new path.

@minrk
Copy link
Member
minrk commented May 17, 2013

@ellisonbg did you want to do the same separation of restful services and human on the js side that you did on the Python side?

@minrk
Copy link
Member
minrk commented May 17, 2013

Also, was I wrong that you were going to put the IPython stuff in a single 'ipython' tree, rather than unpacking each subcomponent at the highest level?

@ellisonbg
Copy link
Member Author

I do but we don't really have those cleanly separated in the js code right now.

Sent from my iPhone

On May 16, 2013, at 7:08 PM, Min RK notifications@github.com wrote:

@ellisonbg did you want to do the same separation of restful services and human on the js side that you did on the Python side?


Reply to this email directly or view it on GitHub.

@minrk
Copy link
Member
minrk commented May 17, 2013

I do but we don't really have those cleanly separated in the js code right now.

Okay, that's for another PR, then?

@Carreau
Copy link
Member
Carreau commented May 19, 2013

If #3321 has beed merged, shouldn't lots of those commits not even show up ?

@minrk
Copy link
Member
minrk commented May 19, 2013

Probably just needs a rebase for them to not show up, which should actually proceed cleanly since those commits are in master.

@Carreau
Copy link
Member
Carreau commented May 22, 2013

Short from my phone.

Are the Line number back in the right place?

Le mercredi 22 mai 2013, Brian E. Granger a écrit :

OK so I think I have found all known style problems. But there is a lot of
styles to check and I very well could have missed some. We might want to
make other changes to the org of the files, but let's start discussing this
version to work towards a merge.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3325#issuecomment-18248107
.

@ellisonbg
Copy link
Member Author

Ahh, good catch I will do that this morning.

@Carreau
Copy link
Member
Carreau commented May 22, 2013

I think I already commented on te faulty commit. IIRC notebook.less
CodeMirror-lines , padding to 0.4 em should be set only to padding-top and
bottom, not left and right.

Le mercredi 22 mai 2013, Brian E. Granger a écrit :

Ahh, good catch I will do that this morning.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3325#issuecomment-18288933
.

@ellisonbg
Copy link
Member Author

OK I have fixed line numbers. Only one other change I might make: create a services directory in static.

@fperez
Copy link
Member
fperez commented May 23, 2013

Here, for the record: this breaks @Carreau's little slideshow mode button, but that's non-official so I wouldn't worry about it. I figure Matthias can update it once the merge goes in.

Otherwise I can't see any problems after running a bunch of stuff.

Given we have no testing of JS, our only recourse is to put this in front of trained monkeys (aka our users and devs), and dog-food it as fast as possible. That will at least give us a fighting chance of catching any serious problems before 1.0.

My vote is to merge it now-ish.

@ellisonbg
Copy link
Member Author

Let me fix the custom.JS stuff first.

Sent from my iPhone

On May 23, 2013, at 4:52 PM, Fernando Perez notifications@github.com wrote:

Here, for the record: this breaks @Carreau's little slideshow mode button, but that's non-official so I wouldn't worry about it. I figure Matthias can update it once the merge goes in.

Otherwise I can't see any problems after running a bunch of stuff.

Given we have no testing of JS, our only recourse is to put this in front of trained monkeys (aka our users and devs), and dog-food it as fast as possible. That will at least give us a fighting chance of catching any serious problems before 1.0.

My vote is to merge it now-ish.


Reply to this email directly or view it on GitHub.

@ellisonbg
Copy link
Member Author

OK I have fixed the custom js/css stuff and have also styled the code/pre elements in rendered_html back to their pre bootstrap versions. As far as I know, this PR is ready to be merged. We can continue to test and fix the css styles in master - the main thing is that the re-org work doesn't seem to have broken anything.

@@ -3,14 +3,14 @@
*
*
* Placeholder for custom user javascript
* mainly to be overridden in profile/static/js/custom.js
* mainly to be overridden in profile/static/custom/custom.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you move it back, thoses sentences shoudl be fixed here and there.

@Carreau
Copy link
Member
Carreau commented May 24, 2013

FYI, I need to look at requie.js, but I intend to write a small ext where you say:
IPython.loadJsExt('foo') and it will look in static: for foo/main.js and inject it in notebook, so that you could have separated folder for plugins. So I indeed find that the user or custom folder is one level too deep for users. But it doesn't prevent us from advising using subdirectories...

@Carreau
Copy link
Member
Carreau commented May 24, 2013

Comments as I use it, I'll modify as long as I discover things.

  • login form weird with button on new line.
  • Prepare an hidden Username field ?
  • Line number gutters rounded on top-right, shouldn't.
  • stderr not any more in red ( 2 other styles overwrites background).
  • heading-x got blue halo when clicked

@minrk
Copy link
Member
minrk commented May 24, 2013

FYI, I need to look at requie.js, but I intend to write a small ext where you say:
IPython.loadJsExt('foo') and it will look in static: for foo/main.js and inject it in notebook, so that you could have separated folder for plugins. So I indeed find that the user or custom folder is one level too deep for users. But it doesn't prevent us from advising using subdirectories...

This should probably be inside the custom dir, to clearly distinguish it as something not shipped with IPython. So loadJSExt('foo') would load static/custom/foo/main.js.

just centers form, rather than allowing it to wrap weirdly
@minrk minrk mentioned this pull request May 24, 2013
@minrk
Copy link
Member
minrk commented May 24, 2013

everything I am aware of has been addressed now.

@fperez
Copy link
Member
fperez commented May 24, 2013

Merging now...

fperez added a commit that referenced this pull request May 24, 2013
Organize the JS and less files by component, in the `static` directory of the notebook.

This PR does the client side re-org that parallels the server side work in #3321.  There are now subdirectories in `static/` for each part of the client; roughly speaking there is one subdir for each page, web service or component.
@fperez fperez merged commit f166c75 into ipython:master May 24, 2013
@ellisonbg ellisonbg deleted the jsreorg branch January 28, 2014 17:48
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Organize the JS and less files by component, in the `static` directory of the notebook.

This PR does the client side re-org that parallels the server side work in ipython#3321.  There are now subdirectories in `static/` for each part of the client; roughly speaking there is one subdir for each page, web service or component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0