{"id":13630122,"url":"https://github.com/ficusjs/ficusjs","last_synced_at":"2025-04-04T19:13:02.298Z","repository":{"id":47431120,"uuid":"297387722","full_name":"ficusjs/ficusjs","owner":"ficusjs","description":"FicusJS is a set of lightweight functions for developing applications using web components","archived":false,"fork":false,"pushed_at":"2023-04-06T07:52:07.000Z","size":17713,"stargazers_count":399,"open_issues_count":6,"forks_count":12,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-28T18:13:46.772Z","etag":null,"topics":["ficusjs","framework","frontend","javascript","web-components"],"latest_commit_sha":null,"homepage":"https://docs.ficusjs.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ficusjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"ficusjs"}},"created_at":"2020-09-21T15:50:22.000Z","updated_at":"2025-03-10T09:03:45.000Z","dependencies_parsed_at":"2024-01-14T08:28:47.475Z","dependency_job_id":"e64d8c81-70d3-4711-8c43-68216b337e71","html_url":"https://github.com/ficusjs/ficusjs","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficusjs%2Fficusjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficusjs%2Fficusjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficusjs%2Fficusjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ficusjs%2Fficusjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ficusjs","download_url":"https://codeload.github.com/ficusjs/ficusjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ficusjs","framework","frontend","javascript","web-components"],"created_at":"2024-08-01T22:01:30.861Z","updated_at":"2025-04-04T19:13:02.259Z","avatar_url":"https://github.com/ficusjs.png","language":"JavaScript","readme":"# FicusJS\n\n\u003cimg src=\"img/ficus-icon-optimised.svg\" alt=\"FicusJS\" width=\"150\" align=\"right\"\u003e\n\nFicusJS is a set of lightweight functions for developing modern web applications using web components.\n\n## Features\n\nFicusJS provides the following features for building modern web applications.\n\n- Fast lightweight web components\n- Extending web components\n  - with renderers\n    - [htm](https://www.npmjs.com/package/htm) (JSX-like syntax - no transpiler necessary)\n    - [htm](https://www.npmjs.com/package/htm) with [Preact](https://www.npmjs.com/package/preact) (JSX-like syntax - no transpiler necessary)\n    - [lit-html](https://www.npmjs.com/package/lit-html)\n    - [uhtml](https://www.npmjs.com/package/uhtml)\n    - css\n  - with local state\n  - with styles\n  - with lazy rendering\n  - with breakpoint rendering\n  - with a finite state machine\n  - with an [XState](https://xstate.js.org/) service\n  - with an application state store\n  - with an event bus\n  - with internationalization (i18n)\n- Fast lightweight publish/subscribe event bus\n- Fast lightweight stores for managing application state\n\n## Documentation\n\nSee the [full documentation](https://docs.ficusjs.org).\n\n## Getting started\n\nThe easiest way to try out FicusJS is using a hello world example.\n\nCreate an `index.html` file and copy the following between the `\u003cbody\u003e` tags.\n\n```html\n\u003chello-world\u003e\u003c/hello-world\u003e\n\n\u003cscript type=\"module\"\u003e\nimport { html, renderer } from 'https://cdn.skypack.dev/@ficusjs/renderers@4/htm'\nimport { createCustomElement } from 'https://cdn.skypack.dev/ficusjs@3/custom-element'\n\ncreateCustomElement('hello-world', {\n  renderer,\n  handleClick () {\n    window.alert('Hello to you!')\n  },\n  render () {\n    return html`\n    \u003cdiv\u003e\n      \u003cp\u003eFicusJS hello world\u003c/p\u003e\n      \u003cbutton type=\"button\" onclick=\"${this.handleClick}\"\u003eClick me\u003c/button\u003e\n    \u003c/div\u003e\n  `\n  }\n})\n\u003c/script\u003e\n```\n\nAlternatively, fork this Codepen to see it in action - [https://codepen.io/ducksoupdev/pen/GRZPqJO](https://codepen.io/ducksoupdev/pen/GRZPqJO)\n\nThe hello world example creates a new [custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) using the `createCustomElement` function and registers it to the `hello-world` tag. It uses the [htm](https://www.npmjs.com/package/htm) JSX-like renderer ([other renderers are available](https://docs.ficusjs.org/renderers/)) for creating HTML from [tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals).\n\nOnce registered, the tag can be used multiple times in HTML and instances can be programmatically obtained using [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)\nor [`element.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector).\n\n## Installation\n\nFicusJS can be installed in a number of ways.\n\n### CDN\n\nWe recommend using native ES modules in the browser.\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { createCustomElement } from 'https://cdn.skypack.dev/ficusjs@3/custom-element'\n\u003c/script\u003e\n```\n\nFicusJS is available on [Skypack](https://www.skypack.dev/view/ficusjs).\n\n### NPM\n\nFicusJS works nicely with build tools such as Snowpack, Webpack or Rollup. If you are using a NodeJS tool, you can install the NPM package.\n\n```bash\nnpm install ficusjs\n```\n\n### Available builds\n\nFicusJS only provides ES module builds. For legacy browsers or alternative modules such as CommonJS, it is recommended to use a build tool to transpile the code.\n\n## Development\n\nHow to set-up FicusJS for local development.\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/ficusjs/ficusjs.git\n```\n\n2. Change the working directory\n\n```bash\ncd ficusjs\n```\n\n3. Install dependencies\n\n```bash\nnpm install # or, yarn install\n```\n\n4. Run the local development server\n\n```bash\nnpm run dev # or, yarn dev\n```\n\nThat's it! Now open http://localhost:8080 to see a local app.\n\n## License\n\nThis project is licensed under the MIT License - see the [`LICENSE`](LICENSE) file for details.\n\n## Contributing to FicusJS\n\nAny kind of positive contribution is welcome! Please help us to grow by contributing to the project.\n\nIf you wish to contribute, you can work on any features you think would enhance the library. After adding your code, please send us a Pull Request.\n\n\u003e Please read [CONTRIBUTING](CONTRIBUTING.md) for details on our [CODE OF CONDUCT](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.\n\n## Support\n\nWe all need support and motivation. FicusJS is not an exception. Please give this project a ⭐️ to encourage and show that you liked it. Don't forget to leave a star ⭐️ before you move away.\n\nIf you found the library helpful, please consider [sponsoring us](https://github.com/sponsors/ficusjs).\n","funding_links":["https://github.com/sponsors/ficusjs"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fficusjs%2Fficusjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fficusjs%2Fficusjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fficusjs%2Fficusjs/lists"}