-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Include CKEditor version number somewhere #1005
Comments
In the license header? Or somewhere as a static property in the editor class (could be done by requiring it from |
The former will be easier to extract with regexp from the source. The latter will be available programmatically in JS. So, we could also have both. |
Note: requiring a version from |
There is one more place where the version number would be really useful: in the DOM as a data attribute of the In users applications CKEditor JS source files are many times merged with other JS files and sometimes obfuscated, which makes getting the version number from source code really cumbersome. |
Alternatively, we could expose it as a global variable. Not very clean and I'm not 100% sure that it'd be accessible in all cases, but polluting the editable element with it isn't cool too. |
The clean solution would be to have import { version as ckeditor5PackageVersion } from '@ckeditor/ckeditor5/package.json';
// ...
this.version = ckeditor5PackageVersion; However, to make it useful |
Exactly. That's why we need a global. No one exposes import { version as ckeditor5PackageVersion } from '@ckeditor/ckeditor5/package.json';
// ...
window.CKEDITOR_VERSION = ckeditor5PackageVersion; |
BTW, we can add a check. If Also, this is exactly the code which we can put in the |
I was thinking if we should have |
BTW, one of the problems here is accessing the global object. It's not always |
Feature: Implemented a module exposing the `CKEDIOR_VERSION` to the global scope. Closes ckeditor/ckeditor5#1005.
Feature: Imported the module providing the `CKEDITOR_VERSION` global constant in the `Editor` class (see ckeditor/ckeditor5#1005).
This is how you can get the version of CKEditor 5 from the console: console.log( CKEDITOR_VERSION ); // -> '11.0.0' |
Currently when I have a js bundle it's hard to determine what version I'm running actually.
The text was updated successfully, but these errors were encountered: