ermouth / cloudwall

A platform for developing, testing, building, deploying and running CouchDB hosted apps.
https://cloudwall.me
MIT License
106 stars 11 forks source link

Syntax coloring #22

Open johs opened 6 years ago

johs commented 6 years ago

JS syntax coloring not aware of templates in my favorite app Ddoc lab

screen shot 2018-04-26 at 14 32 46
ermouth commented 6 years ago

Yes, it‘s known problem of CodeMirror parser, which was fixed very recently. So fix is not yet propagated to public versions of CloudWall and Ddoc Lab. I‘ll get you know when update is ready.

If template literals highlighting is critical right now, consider doing these steps:

johs commented 6 years ago

Not critical:) Easy to isloate in the js code with templates as ddoc fragments too (d,i) => {/*{{.template.hello}}*/}

Another ES6 detail: Uglify in JS resources seems to ignore let and const And how about an ES6 transpiler as a feature on JS resources?:)

ermouth commented 6 years ago

Uglify in JS resources seems to ignore let and const

Can you please give an example, how it looks like? Btw, do you use CloudWall or Ddoc lab standalone? And of which version?

And how about an ES6 transpiler as a feature on JS resources?

Very unlikely. I‘ve made some experiments a year ago, results where disappointing: enormously bloated code, running pretty slow.

johs commented 6 years ago

Thanks, I use Ddoc lab 1.9.20 in CloudWall 2.2.3, couchapp build this is how a build looks like without and with uglifyer

screen shot 2018-04-27 at 07 37 37 screen shot 2018-04-27 at 07 38 01

Looks like const screws things up.

ermouth commented 6 years ago

Looks like const screws things up.

It doesn‘t. Your const is removed since it‘s dead code, never used. However, if you use b somewhere in expression, it will be inlined in expression by value, since its value is precisely known during uglify )

johs commented 6 years ago

Thanks! Uglify really smart too:)