{"id":13739753,"url":"https://github.com/callwait/babel-plugin-react-hiccup","last_synced_at":"2025-05-08T19:34:44.809Z","repository":{"id":32971810,"uuid":"148278473","full_name":"callwait/babel-plugin-react-hiccup","owner":"callwait","description":"Hiccup syntax instead of JSX for React with Babel","archived":false,"fork":false,"pushed_at":"2023-03-04T05:07:02.000Z","size":2676,"stargazers_count":16,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T18:50:58.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/callwait.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-11T07:31:20.000Z","updated_at":"2024-09-19T13:35:16.000Z","dependencies_parsed_at":"2024-04-17T11:37:26.106Z","dependency_job_id":"dbbf1a94-7444-492d-80c0-c786e11f2fd6","html_url":"https://github.com/callwait/babel-plugin-react-hiccup","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":"0.33333333333333337","last_synced_commit":"f84e529e6f564aba83e989629949e8f6c15ecb9b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callwait%2Fbabel-plugin-react-hiccup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callwait%2Fbabel-plugin-react-hiccup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callwait%2Fbabel-plugin-react-hiccup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callwait%2Fbabel-plugin-react-hiccup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/callwait","download_url":"https://codeload.github.com/callwait/babel-plugin-react-hiccup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973622,"owners_count":21834105,"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":[],"created_at":"2024-08-03T04:00:37.195Z","updated_at":"2025-05-08T19:34:44.321Z","avatar_url":"https://github.com/callwait.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["React"],"readme":"# babel-plugin-react-hiccup\n\n[![npm](https://img.shields.io/npm/v/babel-plugin-react-hiccup.svg)](https://www.npmjs.com/package/babel-plugin-react-hiccup)\n\n*Hiccup syntax for React components with Babel.*\n\n*React Native ready.*\n![Alt text](rn-demo.png?raw=true \"React Native ready\")\n\n\n## Example\n\n**Input**\n```js\nconst element = ['h1', \"title\"]\nconst element = ['h2#myId.myClass', \"title\"]\nconst element = ['h3.foo', {className: 'bar'}];\n\nconst nested = ['div',\n  ['p.first', \"first paragraph\"],\n  ['p.second', \"second paragraph\"]\n];\n\nconst component = [MyComponent, {open: true, good: \"yes\", parent: this.parent}];\n```\n\n**Same as**\n```js\nconst element = \u003ch1\u003etitle\u003c/h1\u003e\nconst element = \u003ch2 id=\"myId\" className=\"myClass\"\u003etitle\u003c/h1\u003e\nconst element = \u003ch3 className=\"foo bar\"\u003e\u003c/h1\u003e\n\nconst nested = (\u003cdiv\u003e\n    \u003cp className=\"first\"\u003efirst paragraph\u003c/p\u003e\n    \u003cp className=\"second\"\u003esecond paragraph\u003c/p\u003e\n\u003c/div\u003e)\n\nconst component = \u003cMyComponent open=true good=\"yes\" parent={this.parent}\u003e\n\n```\n\n**Output**\n```js\nconst element = React.createElement('h1', {}, \"title\");\nconst element = React.createElement('h2', {id: 'myId', className: 'myClass'}, \"title\");\nconst element = React.createElement('h3', {className: 'foo bar'});\n\nconst nested = React.createElement('div', {}, \n    React.createElement('p', {className: 'first'}, \"first paragraph\"), \n    React.createElement('p', {className: 'second'}, \"second paragraph\")\n);\n\nconst component = React.createElement(MyComponent, { open: true, good: \"yes\", parent: this.parent });\n\n\n```\n\n## Installation\n\n```\nnpm i babel-plugin-react-hiccup\n```\n\n## Usage\n\n### Via .babelrc\n\n__.babelrc__\n```json\n{\n  \"plugins\": [\"react-hiccup\"]\n}\n```\n\n### Via CLI\n```\nbabel --plugins react-hiccup script.js\n```\n\n### Via Node API\n```js\nrequire(\"babel-core\").transform(\"code\", {\n  plugins: [\"react-hiccup\"]\n});\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallwait%2Fbabel-plugin-react-hiccup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallwait%2Fbabel-plugin-react-hiccup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallwait%2Fbabel-plugin-react-hiccup/lists"}