Comments (7)
Both issues in dcl
v2 are fixed, and a new version 2.0.6 is published in npm
.
BTW, there is another version of dcl
— dcl6. It is a version for ES6 (classes, symbols, and so on). It is not published because there is no documentation, and tests for the debug module are unfinished. Yet, I use it already, and it should be understandable for users of dcl
and, of course, there are tests.
BTW, some features of dcl6
were actually back-ported to dcl
at some point or another.
from delite.
Thanks @uhop! I do know about dcl6 but I don't think we can use it because presumably it doesn't support IE11 (and we need to support IE11). Did I misinterpret?
It would be nice to use because the custom elements V1 API only works with classes. (That's according to https://github.com/webcomponents/custom-elements#es5-vs-es2015)
from delite.
You are correct, but partially. The way to do it nowadays is to use the modern JavaScript supported by all modern browsers, and transpire it for the rest, e.g., IE11, with Babel. Last time I checked dcl6 works when transpiled and used with a standard Web Component shim.
from delite.
Ah that makes sense. Actually we are already transpiling, so I guess we could switch to dcl6, but I'll put it down for a "stage 2" because it's a big syntax change.
It might be nice though if dcl2 created ES6 classes behind the scenes, when ES6 was supported. Or are you already doing that?
from delite.
It does use ES6 classes inside. Something like that:
const NewClass = dcl(BaseClass, Mixin1, Mixin2, Base => class extends Base {
constructor() {
super();
// ... do stuff
}
method1() { /* ... */ }
get prop1() { return this._prop1; }
set prop1(value) { this._prop1 = value; }
});
The usual ES6 class stuff. Plus chains and AOP.
The reason I didn't publish it yet: there is an effort to bring decorators to ES6 classes. The discussion never ends. But I don't want to commit to something totally incompatible with the result. OTOH, for now, I decided to use a separate directive object, which lends itself to future decorators whatever they are. Of course, it is all predicated on them being not completely brain-dead.
Another reason is I didn't decide on packaging yet. Most probably I'll leave it to application developers and provide raw ES6 code.
Look at tests to get the feel. They are mostly ported from dcl
v2.
from delite.
I was actually suggesting the dcl version 2 internally use classes (on supported browsers), so that it could also be used with CustomElementRegistry.define()
. Not sure if it's a good idea or not.
from delite.
Not doable. Unfortunately class
is not a syntax sugar as popularly believed. It is the only way to subclass native objects like Array
or HTMLElement
. It is not possible to do by messing with prototypes in JavaScript. So I had to redo how mixins are defined and how chains/AOP declared. Essentially dcl6
is dcl
v2 with classes and an updated API to facilitate the change.
You can think that dojo.declare()
was for ES3, dcl
was for the incomplete ES5, dcl
v2 is for the complete ES5 (+ properties), dcl6
is for ES6 (+ classes, symbols, more introspection).
from delite.
Related Issues (20)
- Don't set blank attribute values
- HasDropDown: SPACE key doesn't open dropdown when JAWS is running
- HasDropDown: add flag for popup type
- HasDropDown: DOM node leak, old popups not always destroyed.
- FormWidget: caret can jump to end of text while typing
- delite/popup: automatically detect popup size change
- Centered popups disappear on resize in RTL mode
- Viewport: replace polling HOT 1
- element resize observer HOT 4
- delite/popup: replace polling
- Fix iOS focus problems when dialog input element is clicked
- Close dropdown when anchor node scrolled out of view
- delite not working in Safari 12.1 HOT 2
- delite/popup: support scrub gesture to close popup HOT 1
- JAWS browse mode broken in dropdown dialogs
- KeyNav: let handler choose to not handle key
- Shift-tabbing into KeyNav container from browser address bar broken
- ES6 module format conversion
- lit-html preparation and conversion
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 delite.