atomicojs / atomico

Atomico a micro-library for creating webcomponents using only functions, hooks and virtual-dom.
https://atomicojs.dev
MIT License
1.16k stars 43 forks source link

npm package version 0.15.4, but repository is 0.15.3 #22

Closed dy closed 4 years ago

dy commented 4 years ago

Is there a source code discrepancy?

UpperCod commented 4 years ago

I apologize, now it's solved, version 0.15.4 improves the experience of web-components that extend existing elements, eg.

import { h, customElement } from "atomico";

function MyButton() {
  return <host>custom button</host>;
}

export default customElement("my-button", MyButton, {
  base: HTMLButtonElement,
  extends: "button"
});

// import

import MyButton from "./my-button";

console.log(<MyButton></MyButton>); // <button is="my-button"></button>

The idea of importing the module and using it as jsx is to reference its origin, this is beneficial for tree-shaking and debug