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

lib/codemirror.js is gone from version 5.20.0 #4328

Closed
darkmavis1980 opened this issue Oct 20, 2016 · 36 comments
Closed

lib/codemirror.js is gone from version 5.20.0 #4328

darkmavis1980 opened this issue Oct 20, 2016 · 36 comments

Comments

@darkmavis1980
Copy link

There's no codemirror.js file in the repository on version 5.20.0

@marijnh
Copy link
Member

marijnh commented Oct 20, 2016

Yes, that's what the release announcement said. This is by design. If your problem is with bower, I suggest you set up some bower-based mirror, or move to a more 2016-proof package manager.

@marijnh marijnh closed this as completed Oct 20, 2016
@darkmavis1980
Copy link
Author

I can't move to something different than bower as is part of a big project and we can easily swap package manager.

@roparz
Copy link

roparz commented Oct 20, 2016

I can't move to something different than bower.

+1

@marijnh
Copy link
Member

marijnh commented Oct 20, 2016

I'm not going to go out of my way to support bower. I'm not sure what the usual solution is for using bower with a project that has a build step, but I suggest you look into that and set something up outside of this repository.

@mattgodbolt
Copy link

+1 here too; I understand (and sympathise with) the awkwardness of supporting bower with a build step, but it was a bit of a shock. I read the release announcement, but it wasn't clear to me that this broke bower installs!

@darkmavis1980
Copy link
Author

I think I'll be stuck to 5.19.0 for a while

@marijnh
Copy link
Member

marijnh commented Oct 20, 2016

So it seems a lot of people have a hardcoded link to this repository in their bower files. On the one hand, I sympathize, since having your build break is no fun. On the other hand, this here is a source repository, not a package distribution mechanism, and I don't feel responsible for the fact that Bower confuses the two.

As a stopgap solution, you can lock your version to 5.19.0.

The real solution is probably for someone to set up a mirror that includes the build artifacts in the repository, and for bower uses to link to that. This can be automated, and shouldn't be hard.

(Or stop using bower. Long-term, you really want to do that.)

@darkmavis1980
Copy link
Author

It is really that hard to put back that js file? I understand your point, but at the same time you can't force people that use a specific technology, and like my case that we cannot change it to anything more modern easily, just because you believe is the right thing to do.

@roparz
Copy link

roparz commented Oct 20, 2016

It is not hardcoded, codemirror is in the bower registry: https://bower.io/search/?q=codemirror
We just have to type bower install --save codemirror to get it.

@roparz
Copy link

roparz commented Oct 20, 2016

For people who'd like to take this opportunity to get rid of bower, here are some explanation ;-)
https://gofore.com/stop-using-bower/

@marijnh
Copy link
Member

marijnh commented Oct 20, 2016

It is really that hard to put back that js file?

No, it isn't. But that would mean continuing to keep it in there, which I don't want to do -- a repository is for actual sources, not build artifacts.

@marijnh
Copy link
Member

marijnh commented Oct 20, 2016

We just have to type bower install --save codemirror to get it.

That's good to hear. But I assume bower does implement some kind of package ownership. I'm not the one who's published codemirror there, so I doubt I am able to change what it points to.

@roparz
Copy link

roparz commented Oct 20, 2016

Maybe you should create a major version (v6) since this is a breaking change.
Some libraries declare a ^5.0 version, like angular-ui/ui-codemirror.

@marijnh
Copy link
Member

marijnh commented Oct 20, 2016

I've set up a kludge to make this problem less severe -- a fork of CodeMirror without the last release tag here, and a change to the Bower registry pointing the name 'codemirror' at that repo (which I apparently was allowed to, even though I didn't initially publish it there).

This means that installs that refer to codemirror by name should work again, but will get 5.19.0, and will continue to do so until someone takes responsibility for maintaining a bower-installable mirror. (I will help update the bower repository to point at this, once it exists.)

@jtheoof
Copy link

jtheoof commented Oct 20, 2016

I second @roparz comment. I understand your point in removing a bundled file from the repo but this is breaking change for a lot of us.

@marijnh
Copy link
Member

marijnh commented Oct 24, 2016

(Going to leave this open for a while in the hope that people will stop creating new issues for the same problem.)

@tomsommer
Copy link

tomsommer commented Nov 2, 2016

Add "CodeMirror": "~5.19", to bower.json to keep the 5.19 version - although this will prevent future updates and fixes, obviously.

@jrockowitz
Copy link

For an immediate workaround/solution, I am using Drush, which is a Drupal specific build tool, to download the single missing file from

https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.js

and placing it in the already downloaded 'codemirror/lib' directory.

@PixellUp
Copy link

Why not update http://codemirror.net/doc/manual.html? People like my get confused, that codemirror.js from lib folder is removed.

@marijnh
Copy link
Member

marijnh commented Nov 14, 2016

What change would you suggest? Nowhere does the manual suggest you clone a git repository to install the library.

@darkmavis1980
Copy link
Author

Sorry but in the docs you write that you have to use the files in the lib/ folder, but since now you removed the javascript file this no longer apply.
You don't like bower, fine, but at least you should realise that your doc is out of date and you actually don't explain how to implement codemirror on a project now.

The easiest way to use CodeMirror is to simply load the script and style sheet found under lib/ in the distribution, plus a mode script from one of the mode/ directories. For example:

<script src="lib/codemirror.js"></script>
<link rel="stylesheet" href="lib/codemirror.css">
<script src="mode/javascript/javascript.js"></script>

@marijnh
Copy link
Member

marijnh commented Nov 14, 2016

Sorry but in the docs you write that you have to use the files in the lib/ folder, but since now you removed the javascript file this no longer apply.

It absolutely still applies. You just have to do so in a properly built version of the code. I.e. download the zip from the website, install with npm, or run the build process yourself.

@MaxKot
Copy link

MaxKot commented Nov 14, 2016

You just have to do so in a properly built version of the code. I.e. download the zip from the website

Please remove .gitignore from the properly built version. When I extract the library to my source tree lib/codemirror.js has to be added manually because of the .gitignore file.

I use CodeMirror in an ASP.NET project and I don't have npm or node.js in my project. Building codemirror.js as a part of my project would require me to add new tools which I don't really need in my project.

@marijnh
Copy link
Member

marijnh commented Nov 14, 2016

Please remove .gitignore from the properly built version

Done (from the zip)

@minrk
Copy link
Contributor

minrk commented Nov 25, 2016

@marijnh I set up https://github.com/components/codemirror, which is where lots of bower packages that require build steps live, if you'd like to point to that. It's a mirror that grabs the npm package.

@marijnh
Copy link
Member

marijnh commented Nov 25, 2016

@minrk That's perfect! I've updated the bower registry. Thank you for taking responsibility on this.

@marijnh marijnh closed this as completed Nov 25, 2016
@madhukard
Copy link

bower install now failing with below error:

➜ datacollector-ui git:(master) bower install
bower #5.19.0 cached https://github.com/codemirror/bower.git#5.19.0
bower #5.19.0 validate 5.19.0 against https://github.com/codemirror/bower.git#5.19.0
bower #5.19.0 ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/codemirror/bower.git", exit code of #128 remote: Repository not found. fatal: repository 'https://github.com/codemirror/bower.git/' not found

Additional error details:
remote: Repository not found.
fatal: repository 'https://github.com/codemirror/bower.git/' not found

@marijnh
Copy link
Member

marijnh commented Nov 27, 2016

Yes, that repository is gone, since @mrink opened a new one that's actually being maintained. I updated the bower registry to point at that repository. From the output you pasted, it looks like bower is dumb about caching and blindly tries to validate against the outdated link, and crashes when that fails. Maybe bower cache clean helps.

@madhukard
Copy link

Thanks, it is working fine now

@marijnh
Copy link
Member

marijnh commented Jan 6, 2017

@minrk The components/codemirror repo doesn't seem to be updating (it's missing 5.22). Also, it'd be nice if it could restore the old bower.json file.

@minrk
Copy link
Contributor

minrk commented Jan 6, 2017

@marijnh 5.22.0 should be posted now with the bower.json restored.

@marijnh
Copy link
Member

marijnh commented Jan 6, 2017

@minrk Thanks! Any chance this could be automated?

@Fluotonic
Copy link

Fluotonic commented Jul 23, 2017

The best option remains npm here: https://www.npmjs.com/package/codemirror
This way, you get the package properly built for you and there's no more problem with /lib/codemirror.js.

Honestly, I love Bower but NPM is more powerful.

@gplcart
Copy link

gplcart commented Mar 5, 2018

Many people using Composer for assets. It's handy to use only one tool instead of several. The package from http://codemirror.net/codemirror.zip contains all files but there's no version control plus Composer complains about unsecure connection. Very confusing situation. It should be noted in readme

@Rourke101
Copy link

It says I simply have to import the lib/codemirror.js, but - it doesn't exist!

@marijnh
Copy link
Member

marijnh commented May 10, 2019

Don't clone the repository to install. Install with npm or download the zip file form the website.

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