2.0.0-rc.11 • Published 9 months ago

@netflix/x-element v2.0.0-rc.11

Weekly downloads
13
License
Apache-2.0
Repository
github
Last release
9 months ago
  x-element
  _________
 / /__ __\ \
/ / \ \ / \ \
\ \ /_\_\ / /
 \_\_____/_/

A dead simple starting point for custom elements. It provides the following functionality:

  • Efficient DOM generation and data binding using your preferred templating engine
  • Automatic .property to [attribute] reflection (opt-in)
  • Automatic [attribute] to .property synchronization (one-directional, on connected)
  • Simple and efficient property observation and computation
  • Simple delegated event handling
  • Useful error messages

Installation:

Save a local copy to your project:

curl https://raw.githubusercontent.com/Netflix/x-element/main/x-element.js > x-element.js
curl https://raw.githubusercontent.com/Netflix/x-element/main/x-parser.js > x-parser.js
curl https://raw.githubusercontent.com/Netflix/x-element/main/x-template.js > x-template.js

Then import it:

import XElement from '/path/to/x-element.js';

...or load it directly from the web:

import XElement from 'https://deno.land/x/element/x-element.js';

...or use an importmap:

<script type="importmap">
  {
    "imports": {
      "@netflix/x-element": "https://deno.land/x/element/x-element.js"
    }
  }
</script>

Then import it using a bare module specifier...

import XElement from '@netflix/x-element';

...or use a package manager:

npm install @netflix/x-element

Then import it using a bare module specifier...

import XElement from '@netflix/x-element';

Project Philosophy:

  1. No compilation step is necessary for adoption, just import x-element.js
  2. Implement a minimal set of generalized functionality
  3. Make as few design decisions as possible
  4. Presume adopters are browser experts already (stay out of their way)
  5. Follow web platform precedents whenever possible
  6. Remain compatible with any browser which fully supports custom elements
  7. Prioritize simple syntax and useful comments in the code itself
  8. Avoid making developers learn new proprietary stuff
  9. Zero dependencies

Development:

npm install && npm start

Then...

See SPEC.md for all the deets.

2.0.0-rc.2

10 months ago

1.1.1

1 year ago

2.0.0-rc.3

10 months ago

2.0.0-rc.4

10 months ago

2.0.0-rc.5

10 months ago

2.0.0-rc.1

10 months ago

2.0.0-rc.11

9 months ago

2.0.0-rc.10

10 months ago

1.1.2

1 year ago

2.0.0-rc.6

10 months ago

2.0.0-rc.7

10 months ago

2.0.0-rc.8

10 months ago

2.0.0-rc.9

10 months ago

1.1.0

1 year ago

1.0.0

2 years ago

1.0.0-rc.59

2 years ago

1.0.0-rc.58

2 years ago

1.0.0-rc.57

2 years ago

1.0.0-rc.56

3 years ago

1.0.0-rc.53

3 years ago

1.0.0-rc.52

3 years ago

1.0.0-rc.55

3 years ago

1.0.0-rc.54

3 years ago

1.0.0-rc.51

3 years ago

1.0.0-rc.50

4 years ago

1.0.0-rc.49

4 years ago

1.0.0-rc.43

5 years ago

1.0.0-rc.42

5 years ago

1.0.0-rc.41

5 years ago

1.0.0-rc.40

5 years ago

1.0.0-rc.39

6 years ago

1.0.0-rc.38

6 years ago