Skip to content
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

Update external libraries, e.g. jQuery #204

Open
zuphilip opened this issue Jan 22, 2017 · 18 comments
Open

Update external libraries, e.g. jQuery #204

zuphilip opened this issue Jan 22, 2017 · 18 comments

Comments

@zuphilip
Copy link
Member

zuphilip commented Jan 22, 2017

Most of the libraries in external are date 4-5 years old and I am quite sure that most of them have newer version. It seems for me that especially the jQuery library should be updated because currently this will already give some warnings about deprecated code:

Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.  require-jquery.js:5304:28

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/  require-jquery.js:10221:6

It seems that jQuery was packed together with require and some more code in a special JavaScript file require-jquery.js some time ago: 5f06bd6

@rmzelle
Copy link
Member

rmzelle commented Jan 22, 2017

@zuphilip, it looks like that file came from the requirejs project, and it seems that the packed version was deprecated four years ago: http://requirejs.org/docs/jquery.html#oldexample and requirejs/requirejs@c072183#diff-0e4001b2ab34240aa60898bba3618dcdR50

@adam3smith
Copy link
Member

I'm happy to try to help review&test PRs on this, but given my experience with updating js libraries and keeping the code working (i.e. stuff always breaks and it takes a lot of time), I don't think I'll have the time to do this.

@zuphilip
Copy link
Member Author

I think this might be a larger issue and need more work or maybe even more experienced people. I don't think I will have time to look into this any time soon. However, there might be the danger, that at some time any of this deprecated things will break it completely.

Here is another example: One of the core library might also be jstree, where currently the pre 1.0 version is used, but at the moment there is version 3.3.3 out, i.e. the last 720 commits of this library is missing for the csl-editor.

@rmzelle
Copy link
Member

rmzelle commented Jan 22, 2017

I'm happy to try to help review&test PRs on this, but given my experience with updating js libraries and keeping the code working (i.e. stuff always breaks and it takes a lot of time), I don't think I'll have the time to do this.

Did you have to do anything special this time around to keep things working? You mentioned elsewhere that the citeproc-js library was giving troubles again.

@rmzelle
Copy link
Member

rmzelle commented Jan 22, 2017

(I'm still working up the courage to try out the build script)

@adam3smith
Copy link
Member

adam3smith commented Jan 22, 2017

I'd have to look, but we have some CSL money left, though I'm afraid I'm not too optimistic about us getting any more. All of our management-level contacts with Springer/Papers and Elsevier/Mendeley have dried up.

@adam3smith
Copy link
Member

adam3smith commented Jan 22, 2017

Did you have to do anything special this time around to keep things working?

This time around, citeproc-js threw an error: Juris-M/citeproc-js#28
Last time, I managed to align all libraries installed via npm to use up-to-date versions, so that's great.
Also, the configure.sh script just runs a long time, so that any errors that don't break it immediately are "costly" in terms of time.

@zuphilip
Copy link
Member Author

zuphilip commented Jan 23, 2017

Okay, I have now a developing environment with docker:

git clone --recursive https://github.com/citation-style-editor/csl-editor-demo-site.git csl-editor-demo-site
cd csl-editor-demo-site
docker run --rm -ti -p 5001:5001 -v `pwd`:/srv/jekyll jekyll/jekyll jekyll serve --watch

That was easier than expected. Maybe, I can look closer here...

@rmzelle
Copy link
Member

rmzelle commented Jan 25, 2017

@zuphilip, how will running it in Docker help you? (curious since I have no experience with Docker)

@zuphilip
Copy link
Member Author

Most of the time I work under windows and don't have Jekyll (or Node.js) installed. Therefore, I can use now Docker to set up an development version and let the Docker image deal with all the prerequisites. The -v option will map my current directory into the Docker image, such that every change I make locally will also effect the Docker image (and vice versa) and because Jekyll is "watching" the source will be rebuild, such that when I look at the local website at http://localhost:5001 the changes are visible directly (or I can just rerun the tests).

There might be more direct ways without Docker to achieve the same. However, for me the Docker way is easy and clean way for running a "local server" for development. One general advantage is that the Docker containers are "encapsulate" and clean such that no other process or previous installation of something might lead to different solutions. Moreover, it is possible to use the same version with Docker also in production (can't judge here other aspects as security).

@rmzelle
Copy link
Member

rmzelle commented Jan 25, 2017

Cool. So how long do the builds take with your setup?

(also, do you have any recommended resources for those new to Docker? I tinker a little with Linux VMs at work for running some bioinformatics tools, and I have the impression that switching to Docker might be easier for me)

@zuphilip
Copy link
Member Author

So how long do the builds take with your setup?

Technically I don't "build" the docker images but I just "run" one. So the first time the image will be actually downloaded from https://hub.docker.com/r/jekyll/jekyll/ (~ 50 MB) and the time depends on your internet connection. From now on starting/running this docker container takes just some seconds. Inside the docker container Jekyll starts and this take mabey up to a minute, but this time you always have.

My general impression is that Docker is fast and also not taking much resources, except that disk space is used easily with docker images and containers and maybe also older things one would not need any longer...

You can find my personal (chaotic) notes about Docker here https://hackmd.io/MbCsBMAZQFlBaAhgI3MeMBMBOc8AcOA7PJgIwTADMApjAGxn6hA=#

@rmzelle
Copy link
Member

rmzelle commented Jan 25, 2017

Technically I don't "build" the docker images but I just "run" one.

Ah, okay. So you just do "jekyll serve" as written at https://github.com/citation-style-language/csl-editor-demo-site#to-setup-development-version

I thought you were running deploy.sh within Docker as well, which is why I was asking about build times.

@adam3smith
Copy link
Member

adam3smith commented Jan 25, 2017 via email

@rmzelle
Copy link
Member

rmzelle commented Jan 25, 2017

Also, the configure.sh script just runs a long time, so that any errors that don't break it immediately are "costly" in terms of time.

FWIW, deploy.sh is a tiny script that's almost instantaneous as it just
copies some files and then runs gh commands on them. It's configure.sh in
the csl-editor-library that runs a long time because it calculates all the
example files.

Ah, okay. I didn't know what the exact purpose of deploy.sh was. Since we can run the test suite and editor itself straight via Jekyll, we only really need the deploy.sh for regenerating the examples for SearchByExample, and for pushing the results to GitHub Pages?

@adam3smith
Copy link
Member

adam3smith commented Jan 25, 2017 via email

@rmzelle
Copy link
Member

rmzelle commented Jan 25, 2017

Oh, you have to run configure.sh by hand? (https://github.com/citation-style-language/csl-editor-demo-site/blob/master/README.md is silent on it)

@adam3smith
Copy link
Member

adam3smith commented Jan 25, 2017 via email

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

No branches or pull requests

3 participants