Closed swooboo closed 7 years ago
I personally have no opinion on this, as I've never used anything but plain JavaScript, JQuery and NodeJS. I also haven't done anything serious in JavaScript in months, currently hacking on a Python project, so there's really no useful info I can give here.
But did you at least briefly go over the Babel page? Do you like how the code looks?
It looks reasonable, I suppose.
Trying. Having some problems running locally with XMLHttpRequest cannot load file://
, it appears that Babel loads 'text/babel' <script>
tags with AJAX... Any ideas? See this branch - https://github.com/swooboo/HERITAGE/tree/babel-emca.
I don't really have the time to check now but I believe the original HERITAGE readme says that you can't use Chrome for playing locally as it blocks local URLs and that Firefox should work because the policy is less strict there. You may very well be running into that.
On 22 September 2016 08:40:16 CEST, swooboo notifications@github.com wrote:
Trying. Having some problems running locally with
XMLHttpRequest cannot load file://
, it appears that Babel loads 'text/babel'<script>
tags with AJAX... Any ideas? See this branch - https://github.com/swooboo/HERITAGE/tree/babel-emca.You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/swooboo/HERITAGE/issues/2#issuecomment-248824597
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Works like a charm, thanks. I forgot about this...
For OOO and cleaner JavaScript you may also consider TypeScript. http://www.typescriptlang.org/ http://www.typescriptlang.org/play/index.html
Thank you @bd82, I'll definitely look into it. If I may ask, why would one prefer it over ECMA6 Script? I'll probably get the answer after some reading, but in this case I'd like a spoiler please :)
The question is not about ECMAScript 6 vs TypeScript.
If you use Babel you are not using ECMAScript 6. The ECMAScript standard keeps evolving with both of these options you will be using ECMAScript Next. ECMA6 is also known as ECMA 2015, the ECMA2016 spec is already out and a new spec will be released every year hence forth...
ES Next means a combination of features of from future ECMAScript versions.
I Guess the two biggest differences between Babel and TypeScript are:
Either of these options are good and much better then using ECMAScript 5. I'm a big fan of static types so perhaps that is why I prefer TypeScript. Or maybe just because I've used it for a few years now and am simply familiar with it. 😄
Thank you @bd82, from your explanation I gather that my Babel way fits my needs perfectly. I don't really need static typing in HERITAGE, although it is, indeed, a nice feature. Thanks.
Let's discuss using the next generation EMCA for this project. It's easier to write clean and object-oriented code in it, and to support all the browsers there is Babel compiler, read here - https://babeljs.io. @TheLastProject, what do you think?