Skip to content

Commit 14d5157

Browse files
committed
add tests for lwc
1 parent e4c569e commit 14d5157

29 files changed

+7111
-4948
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ npm start
3131
- [Hybrids](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/hybrids)
3232
- [Hyperapp](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/hyperapp)
3333
- [HyperHTML](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/hyperhtml)
34+
- [Lit](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/lit)
35+
- [LWC](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/lwc)
3436
- [Mithril](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/mithril)
3537
- [Omi](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/omi)
3638
- [Polymer](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/polymer)

docs/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const libraryMap = {
2828
hyperapp: "Hyperapp",
2929
hyperhtml: "hyperHTML",
3030
lit: "Lit",
31+
lwc: "LWC",
3132
mithril: "Mithril",
3233
omi: "Omi",
3334
polymer: "Polymer",

libraries/lwc/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org

libraries/lwc/karma.conf.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
var webpack = require('webpack');
19-
var path = require('path');
20-
var LwcWebpackPlugin = require('lwc-webpack-plugin');
18+
const path = require('path');
19+
const LwcWebpackPlugin = require('lwc-webpack-plugin');
2120

2221
module.exports = function(config) {
2322
config.set({
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"success": 30,
3-
"failed": 0,
2+
"success": 24,
3+
"failed": 8,
44
"skipped": 0,
55
"error": false,
66
"disconnected": false,
7-
"exitCode": 0,
8-
"score": 100,
7+
"exitCode": 1,
8+
"score": 89,
99
"basicSupport": {
1010
"total": 16,
1111
"failed": 0,
1212
"passed": 16
1313
},
1414
"advancedSupport": {
15-
"total": 14,
16-
"failed": 0,
17-
"passed": 14
15+
"total": 16,
16+
"failed": 8,
17+
"passed": 8
1818
}
1919
}

libraries/lwc/meta/issues.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
[]
1+
[
2+
{
3+
"link": "https://github.com/salesforce/lwc/issues/1904",
4+
"title": "Unnecessary event name restrictions (such as prohibiting hyphens) should be removed",
5+
"meta": "#1904 opened May 28, 2020 by JanMiksovsky"
6+
}
7+
]

libraries/lwc/meta/summary.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
<h4 id="vue-handling-data">Handling data</h4>
1+
<h4 id="lwc-handling-data">Handling data</h4>
22

3-
By default, Vue passes all data to Custom Elements as attributes. However, Vue
4-
also provides syntax to instruct its bindings to use properties instead. To bind
5-
to a Custom Element property use <code>:foo.prop="bar"</code>.
3+
When passing data to a custom element, LWC takes a properties-if-available approach where attributes
4+
are set by default, but properties are set when they exist. This heuristical approach involves a
5+
runtime check to see whether a property is defined, and as such, data will be passed as an attribute
6+
if the custom element has not been upgraded. It is the responsibility of the component author to
7+
handle this scenario.
68

7-
<h4 id="vue-handling-events">Handling events</h4>
9+
<h4 id="lwc-handling-events">Handling events</h4>
810

9-
Vue can listen to native DOM events dispatched from Custom Elements. Its
10-
declarative event bindings only support lowercase and kebab case events. To
11-
listen for any events named with capital letters you must write imperative code.
11+
LWC has no restrictions on event names when listening for events imperatively via the
12+
`addEventListener()` API. When listening for events declaratively in the template, LWC supports
13+
neither arbitrarily capitalized event names (camelCase, CAPSCase, PascalCase, etc.) nor kebab-cased
14+
names.

0 commit comments

Comments
 (0)