ckeditor / ckeditor5-design

☠ Early discussions about CKEditor 5's architecture. Closed now. Go to https://github.com/ckeditor/ckeditor5 ☠
58 stars 12 forks source link

Should we use ES6 in documentation? #154

Closed Reinmar closed 7 years ago

Reinmar commented 8 years ago

The whole code is in ES6, so it's natural for us to use ES6 in documentation. We've done so in API docs so far and most likely will do so in guides, otherwise risking multiple personality disorder (like you have with two code styles).

The only problem is with samples which should run out of the box in all browsers that we plan to support... which includes IE11 :<. So, there are two options:

The 2nd option seems to be simpler and safer because the samples code will work everywhere. The only downside that it has is that in API docs and guides people will find ES6, when in samples they will not. OTOH, this is unavoidable because the whole code is ES6 anyway, so unless we keep everything ES6 way, there's always be inconsistency.

Reinmar commented 8 years ago

PS. One note - sample codes will be fairly simple, so there won't be much ES6 there. Some arrow functions and perhaps not more.

scofalik commented 8 years ago

I was going to say that I am for having ES6 everywhere and transpile samples code, but if you say that samples will be simple I am not sure.

If sample code will be easy to write without ES6 and it will look natural, we should be fine. Maybe people won't even notice that something is different.

Also, if developers want to use CKE5 in their apps but don't want to use transpilers, we should give them opportunity to see how the sample code looks like without using ES6.

I am for second option.

pomek commented 8 years ago

I have the same feeling like @scofalik.

The main question is - how many features from ES6 will we use? And second question - Are the features like "kill features" or more like "easier to development for us"?

Samples will be simple code, so we can do exception. I'm also for second proposition.

pjasiun commented 8 years ago

I think that we will support IE11 only for some time. Microsoft is doing it's best to move people to Windows 10 and Edge, so in, more-less, 2 years we may be able to drop IE11 support. I wonder what will happen with our sample then? Will we rewrite them to ES6?

Reinmar commented 8 years ago

Related ticket about browser support: https://github.com/ckeditor/ckeditor5/issues/236.

Reinmar commented 8 years ago

I realised that samples code will be accompanied by a lot of test code, so we cannot disable ES6 globally for samples/ directory (which would be yet another .jshintrc file with all the rules). It will be better to either disable ES6 for specific JS files or even for specific part of them.

Reinmar commented 7 years ago

I can see that we all used to ES6 and that all browsers supported by CKE5 support ES6 on such a level that we don't need to transpile our code at all that ES6 can be freely used in the docs.