Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Web Components #6

Open
2zH opened this issue Jul 28, 2017 · 4 comments
Open

About Web Components #6

2zH opened this issue Jul 28, 2017 · 4 comments

Comments

@2zH
Copy link
Owner

2zH commented Jul 28, 2017

TodoList

- [ ] Polyfills
- [ ] Framework
- [ ] Bundler
- [ ] Web Components with React and Vue
- [ ] Browser Support

To be continue......
Sorry...

@2zH
Copy link
Owner Author

2zH commented Jul 28, 2017

Polyfills

Web Components

  • Custom Element
  • HTML Import
  • HTML Template
  • Shadow DOM

Browser support of polyfills: >= IE 11
Env test: http://html5test.com/

ECMAScripts 7+

  • babel-core v7.0.0-alpha.17
  • babel-preset-stage-0-alpha.17
  • babel-preset-env: v2.0.0-alpha.17

Note: It won't include stage-x plugins. env will support all plugins in what we consider the latest version of JavaScript (by matching what we do in babel-preset-latest).

  • Installation:
npm install \
babel-core@next \
babel-preset-env@next \
babel-preset-stage-0@next -D

Stage-0:

  • babel-plugin-transform-do-expressions
  • babel-plugin-transform-function-bind

Stage-1

  • babel-plugin-transform-decorators
  • babel-plugin-transform-export-extensions
  • babel-plugin-transform-numeric-separator
  • babel-plugin-transform-optional-chaining

Stage-2

  • babel-plugin-transform-class-properties
  • babel-plugin-transform-function-sent2

Stage-3

  • babel-plugin-syntax-dynamic-import
  • babel-plugin-transform-async-generator-functions
  • babel-plugin-transform-object-rest-spread
  • babel-plugin-transform-unicode-property-regex

CSS 4

@2zH
Copy link
Owner Author

2zH commented Jul 28, 2017

Browser Support

- Edge: Microsoft Edge and Web Components

@2zH
Copy link
Owner Author

2zH commented Jul 29, 2017

Web Component

Life Cycle

  • constructor

when the element is created or upgraded

  • connectedCallback

when the element is inserted into a document, including into a shadow tree

  • disconnectedCallback

when the element is removed from a document

  • attributeChangedCallback(attributeName, oldValue, newValue, namespace)

when an attribute is changed, appended, removed, or replaced on the element. Only called for observed attributes.

  • adoptedCallback(oldDocument, newDocument)

when the element is adopted into a new document

[idea] Allow HTML Element attributes to accept any type of value, not just strings: WICG/webcomponents#519

The difference between Custom Elements and React JSX

  • JSX props accept any type of value but element attributes only accept string
  • JSX look like a function wrapper, through props to control childrens JSX.

@2zH
Copy link
Owner Author

2zH commented Aug 25, 2017

Framework

  • Polymer: Web component library by Google.
  • SkateJS: Functional web component library.
  • StencilJS: A Compiler for Web Components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant