@netflix/x-element
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -0,1 +1,7 @@ | ||
/** | ||
* Await document completeness. Will likely be replaced by built-in apis. | ||
* Check out https://github.com/Netflix/x-element/issues/65 for details. | ||
* @param {Document} target | ||
* @returns {Promise<any>} | ||
*/ | ||
const ready = target => { | ||
@@ -2,0 +8,0 @@ return new Promise(resolve => { |
{ | ||
"name": "@netflix/x-element", | ||
"description": "A dead simple starting point for custom elements.", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"license": "Apache-2.0", | ||
"repository": "https://github.com/Netflix/x-element", | ||
"repository": "github:Netflix/x-element", | ||
"type": "module", | ||
"main": "x-element.js", | ||
"module": "x-element.js", | ||
"types": "x-element.d.ts", | ||
"exports": { | ||
"./x-element.js": "./x-element.js", | ||
"./x-element.d.ts": "./x-element.d.ts", | ||
"./etc/ready.js": "./etc/ready.js", | ||
"./etc/ready.d.ts": "./etc/ready.d.ts" | ||
}, | ||
"publishConfig": { | ||
@@ -20,2 +23,3 @@ "access": "public", | ||
"test": "node test.js | tap-parser -l", | ||
"type": "tsc", | ||
"bump": "./bump.sh" | ||
@@ -25,2 +29,4 @@ }, | ||
"/x-element.js", | ||
"/x-element.d.ts", | ||
"/x-element.d.ts.map", | ||
"/demo", | ||
@@ -30,8 +36,14 @@ "/test", | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"eslint": "^8.56.0", | ||
"puppeteer": "^22.0.0", | ||
"tap-parser": "^15.3.1" | ||
"@netflix/eslint-config": "^3.0.0", | ||
"eslint-plugin-jsdoc": "^50.3.1", | ||
"eslint": "^9.12.0", | ||
"puppeteer": "^23.5.3", | ||
"tap-parser": "^18.0.0", | ||
"typescript": "^5.6.3" | ||
}, | ||
"engines": { | ||
"node": "20.18.0", | ||
"npm": "10.8.2" | ||
}, | ||
"contributors": [ | ||
@@ -38,0 +50,0 @@ { |
@@ -13,4 +13,3 @@ ``` | ||
- Efficient element generation and data binding via an integrated templating engine | ||
- ...or use another engine (e.g., [lit-html](https://lit.dev)) | ||
- Efficient DOM generation and data binding using your preferred [templating engine](./doc/TEMPLATES.md) | ||
- Automatic `.property` to `[attribute]` reflection (opt-in) | ||
@@ -25,2 +24,3 @@ - Automatic `[attribute]` to `.property` synchronization (one-directional, on connected) | ||
``` | ||
# save a local copy | ||
curl https://raw.githubusercontent.com/Netflix/x-element/main/x-element.js > x-element.js | ||
@@ -31,2 +31,3 @@ ``` | ||
``` | ||
# load it from the web | ||
import XElement from 'https://deno.land/x/element/x-element.js'; | ||
@@ -37,2 +38,3 @@ ``` | ||
``` | ||
# use a package manager | ||
npm install @netflix/x-element | ||
@@ -61,2 +63,3 @@ ``` | ||
See [SPEC.md](./SPEC.md) for all the deets. | ||
See [SPEC.md](./doc/SPEC.md) for all the deets. | ||
@@ -16,2 +16,3 @@ import { test, coverage } from './x-test.js'; | ||
test('./test-render-root.html'); | ||
test('./test-styles.html'); | ||
test('./test-basic-properties.html'); | ||
@@ -18,0 +19,0 @@ test('./test-initial-properties.html'); |
import XElement from '../x-element.js'; | ||
import { assert, it } from './x-test.js'; | ||
class TestElement extends XElement { | ||
class TestElement1 extends XElement { | ||
static createRenderRoot(host) { | ||
@@ -14,10 +14,10 @@ return host; | ||
} | ||
customElements.define('test-element', TestElement); | ||
customElements.define('test-element-1', TestElement1); | ||
it('test render root was respected', () => { | ||
const el = document.createElement('test-element'); | ||
const el = document.createElement('test-element-1'); | ||
document.body.append(el); | ||
assert(el.shadowRoot === null); | ||
assert(el.textContent === `I'm not in a shadow root.`); | ||
el.remove(); | ||
}); | ||
@@ -29,3 +29,3 @@ | ||
} | ||
customElements.define('test-element-1', BadElement); | ||
customElements.define('test-element-2', BadElement); | ||
let passed = false; | ||
@@ -32,0 +32,0 @@ let message = 'no error was thrown'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
290634
66
7428
61
6