Skip to content
/ core Public

🎨 Jwc.js is a JavaScript framework for using JSX to write web components on the web.

License

Notifications You must be signed in to change notification settings

jwcjs/core

Repository files navigation

@jwcjs/core

All Contributors

🎨 Jwc.js is a JavaScript framework for using JSX to write web components on the web.

πŸ§ͺ Working in Progress

TODO

After the following tasks are completed, we will publish Release v0.1.0.alpha.0

  • Data Reactively
  • Inject style
  • JSX TypeScript Support
  • <Fragment /> Support
  • Vite Fully Support
  • Function Component Support

Usage

npm i @jwcjs/core

Class Component (Feature Preview)

import { JwcComponent, Component } from "@jwcjs/core";
import { h } from "@jwcjs/runtime";
import style from './App.css'

@Component({
  name: "app-element",
  css: style
})
export class App extends JwcComponent {

  @Props()
  hello: string

  public override render() {
    return (
      <div>
        <h1>Hello World</h1>
        <span>{this.hello}</span>
      </div>
    )
  }
}

Function Component (Feature Preview)

import { registerFunctionComponent } from "@jwcjs/core";
import style from './App.css'

export function App() {
  useStyle(style)
  
  const [hello, setHello] = useState<string>("Hi")
  
  return (<></>)
}

registerFunctionComponent("app-element", <App />);

Contributors

AkaraChen
AkaraChen

πŸ’»

License

MIT