Skip to content

Commit

Permalink
add tests for lwc
Browse files Browse the repository at this point in the history
  • Loading branch information
ekashida committed Nov 15, 2023
1 parent e4c569e commit 14d5157
Show file tree
Hide file tree
Showing 29 changed files with 7,111 additions and 4,948 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ npm start
- [Hybrids](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/hybrids)
- [Hyperapp](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/hyperapp)
- [HyperHTML](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/hyperhtml)
- [Lit](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/lit)
- [LWC](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/lwc)
- [Mithril](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/mithril)
- [Omi](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/omi)
- [Polymer](https://github.com/webcomponents/custom-elements-everywhere/tree/master/libraries/polymer)
Expand Down
1 change: 1 addition & 0 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const libraryMap = {
hyperapp: "Hyperapp",
hyperhtml: "hyperHTML",
lit: "Lit",
lwc: "LWC",
mithril: "Mithril",
omi: "Omi",
polymer: "Polymer",
Expand Down
1 change: 1 addition & 0 deletions libraries/lwc/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
5 changes: 2 additions & 3 deletions libraries/lwc/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* limitations under the License.
*/

var webpack = require('webpack');
var path = require('path');
var LwcWebpackPlugin = require('lwc-webpack-plugin');
const path = require('path');
const LwcWebpackPlugin = require('lwc-webpack-plugin');

module.exports = function(config) {
config.set({
Expand Down
14 changes: 7 additions & 7 deletions libraries/lwc/meta/expectedResults.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"success": 30,
"failed": 0,
"success": 24,
"failed": 8,
"skipped": 0,
"error": false,
"disconnected": false,
"exitCode": 0,
"score": 100,
"exitCode": 1,
"score": 89,
"basicSupport": {
"total": 16,
"failed": 0,
"passed": 16
},
"advancedSupport": {
"total": 14,
"failed": 0,
"passed": 14
"total": 16,
"failed": 8,
"passed": 8
}
}
8 changes: 7 additions & 1 deletion libraries/lwc/meta/issues.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
[]
[
{
"link": "https://github.com/salesforce/lwc/issues/1904",
"title": "Unnecessary event name restrictions (such as prohibiting hyphens) should be removed",
"meta": "#1904 opened May 28, 2020 by JanMiksovsky"
}
]
19 changes: 11 additions & 8 deletions libraries/lwc/meta/summary.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<h4 id="vue-handling-data">Handling data</h4>
<h4 id="lwc-handling-data">Handling data</h4>

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

<h4 id="vue-handling-events">Handling events</h4>
<h4 id="lwc-handling-events">Handling events</h4>

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

0 comments on commit 14d5157

Please sign in to comment.