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

Builder should set CKEDITOR.isDebug to false and remove unreachable code #27

Closed
Reinmar opened this issue Oct 2, 2015 · 1 comment
Closed
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Oct 2, 2015

In https://github.com/ckeditor/ckeditor5-core/issues/38 we proposed couple of logging mechanisms, one of them being the CKEDITOR.isDebug property which can be used to wrap debug code.

         *      if ( CKEDITOR.isDebug ) {
         *          if ( doSomeSuperUnnecessaryDebugChecks() ) {
         *              throw new CKEditorError( 'sth-broke: Kaboom!' );
         *          }
         *      }

The builder should have an option (enabled by default) to set that property to false and also to remove unreachable code. The Uglify.js has a --define option which allows to preset some variable and then remove code that will not be reachable, but I'm not sure if it's going to work with an object property. If this will be a problem, then we can:

  1. Rename CKEDITOR.isDebug to CKEDITOR_DEBUG, but that would be ugly, as we also have CKEDITOR.isDev which could also be covered by a similar mechanism.
  2. Add our own extension to Uglify.js which will check this.
@Reinmar
Copy link
Member Author

Reinmar commented Jan 7, 2016

We removed CKEDITOR.isDebug so far. Thanks to the transpilation step we can introduce some DEBUG global now, but so far we haven't used the previous property, so let's do this once it's needed.

@Reinmar Reinmar closed this as completed Jan 7, 2016
@Reinmar Reinmar modified the milestone: 0.1.0 Mar 4, 2016
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

1 participant