Comments (6)
Why not involve with ES6 (ES2015 now), native support for class syntax
from cocoabean.
@nightire I remember there is a tool to compile ES6 into ES5. What's the name and is it easy to setup?
from cocoabean.
@cheunghy There're bunch of project can make it happen, my personal recommendation is Babel, very easy to setup and use, just a pure node module, you can use it as a command or in node script.
from cocoabean.
I found this: https://github.com/babel/ruby-babel-transpiler
Officially supported by babel.
Indeed, ES6 syntax will be support by CocoaBean.
How about user just wants to write ES5?
from cocoabean.
ES6 is superset of ES5, it doesn't prevent user write valid ES5 codes, except lacks of some new features that ONLY provided ES6. For example, the Class
syntax is just a sugar layer implements the prototype based OO system, users can still write equivalent ES5 codes to archive these.
BTW, by using Babel, you can easily translate ES6 to ES5, so basically it still runs with ES5 codes for now.
from cocoabean.
@nightire Thanks.
So the answer comes out:
User declare a javaScript class in ES6.
And CocoaBean will convert when generating target application js file.
from cocoabean.
Related Issues (20)
- Code inline documentation for web platform
- scroll view implementation for web platform HOT 1
- text view implementation for web platform
- How to reuse code for different platforms?
- Add missing test for web platform HOT 1
- Implement CB.Button for web platform
- Complete gesture dispatch code for web platform HOT 1
- Make text and image unselectable for normal image view and label view HOT 1
- web CB.LabelView, set text is not html escaped HOT 1
- Add method to get app's running environment HOT 1
- web platform: Add missing default value to properties
- Set cursor for CB.TextButton on web platform HOT 1
- Uniform networking api on all platforms HOT 5
- View animation api
- view shouldn’t call load layer in view’s constructor on web platform
- When error occurs, need ui to present it. HOT 1
- Core extension to Array, String and Object HOT 1
- Add archive and serialization feature
- Image on all platforms HOT 1
- Color manipulation functions on all platforms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocoabean.