{"id":17382231,"url":"https://github.com/1j01/react-script","last_synced_at":"2025-04-15T09:40:08.042Z","repository":{"id":28768179,"uuid":"32290558","full_name":"1j01/react-script","owner":"1j01","description":"An elegant DSL for React - DEPRECATED: CoffeeScript 2 has JSX built in! http://coffeescript.org/v2/#jsx (requires a separate JSX→JS conversion)","archived":false,"fork":false,"pushed_at":"2018-06-13T05:10:10.000Z","size":23,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T18:51:56.751Z","etag":null,"topics":["classnames","coffeescript","dsl","glue","hyperscript","jsx","library","module","react","wrapper"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-script","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1j01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-15T23:44:07.000Z","updated_at":"2021-05-26T06:21:03.000Z","dependencies_parsed_at":"2022-09-11T08:41:56.594Z","dependency_job_id":null,"html_url":"https://github.com/1j01/react-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Freact-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Freact-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Freact-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Freact-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1j01","download_url":"https://codeload.github.com/1j01/react-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637832,"owners_count":21137538,"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":["classnames","coffeescript","dsl","glue","hyperscript","jsx","library","module","react","wrapper"],"created_at":"2024-10-16T07:35:54.517Z","updated_at":"2025-04-15T09:40:08.013Z","avatar_url":"https://github.com/1j01.png","language":"CoffeeScript","readme":"\n# ReactScript\n\nAn elegant, flexible DSL for React\nfor use with CoffeeScript\n(and maybe other languages)\n\nWith CoffeeScript:\n\n```coffee\n# Alias it as whatever you want (maybe _ or $?)\nE = ReactScript or require \"react-script\"\n\nclass Message extends React.Component\n\trender: -\u003e\n\t\tE \".message\", class: (if @props.author is you then \"from-you\"),\n\t\t\tE \".info\",\n\t\t\t\tstyle: float: \"right\"\n\t\t\t\t\"From \"\n\t\t\t\tE \"span.author\", @props.author\n\t\t\t\t\" at \"\n\t\t\t\tE \"span.time\", @props.time\n\t\t\tE \"p.body\",\n\t\t\t\t@props.text\n\t\t\t\tif @props.fileTransfers\n\t\t\t\t\tE \".transfers\",\n\t\t\t\t\t\t\"Sent files:\"\n\t\t\t\t\t\tE \"ul.files\",\n\t\t\t\t\t\t\tfor transfer in @props.fileTransfers\n\t\t\t\t\t\t\t\tE \"li\", E \"a\",\n\t\t\t\t\t\t\t\t\thref: transfer.downloadLink\n\t\t\t\t\t\t\t\t\tdownload: transfer.fileName\n\t\t\t\t\t\t\t\t\ttransfer.fileName\n\nmessage = E Message,\n\tauthor: \"John\"\n\ttime: \"5:47 PM\"\n\ttext: \"Hello world!\"\n\tfileTransfers: [\n\t\t{fileName:  \"virus.exe\", downloadLink: \"#\"}\n\t]\n\nReactDOM.render message, document.body\n\n```\n\nBy simply supporting arrays and ignoring nully values,\nit works with all forms of conditionals and comprehensions.\n\nAll the functionality of [classnames](https://github.com/JedWatson/classnames)\nis built in. Just provide any\nclass, classes, className, classNames or classList.\nAll those properties are treated the same and can be\na single class name,\na single string with multiple class names,\nan object where the keys are the class names and the values are whether they should be present,\nor an array of any of the preceding.\nNully values are ignored, allowing for conditionals.\n\nThe whole library tries to be pretty flexible.\n\nYou can specify `data-*` and `aria-*` properties\neither as e.g. `\"data-size\"`/`\"aria-pressed\"`\nor `dataSize`/`ariaPressed`\nor `data_size`/`aria_pressed` \nor `data: size: 1.337`/`aria: pressed: true`.\n(ARIA's `role` attribute is just `role`.)\n\nCheck out the [specs](https://github.com/1j01/react-script/tree/master/spec/tests) for more details.\n\nIf you find something that doesn't work as you'd hope,\nfeel free to [open an issue](https://github.com/1j01/react-script/issues).\n\n\n## Installation\n\n`npm i react-script --save`\n\n## Usage\n\nYou can use ReactScript through a bundler like [browserify][] or [webpack][], or you can include it as a script:\n\n```html\n\u003cscript src=\"node_modules/react-script/lib/react-script.js\"\u003e\u003c/script\u003e`\n```\n\nThen alias `ReactScript` as something short such as `E` to use as a DSL.\n\n```js\nvar E = ReactScript; // or require(\"react-script\");\n```\n\n[webpack]: https://webpack.github.io/\n[browserify]: http://browserify.org/\n\n## Run tests\n\n`npm test`\n\n\n## Similar Projects\n\n* [hyperscript](https://github.com/dominictarr/hyperscript)\n  (generates HTML)\n* [react-hyperscript](https://github.com/mlmorg/react-hyperscript)\n  (hyperscript for React)\n* [virtual-hyperscript](https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript)\n  (hyperscript for [virtual-dom](https://github.com/Matt-Esch/virtual-dom))\n* [zorium](https://github.com/Zorium/zorium)\n  (framework for virtual-dom)\n* [hyper](https://github.com/xixixao/hyper)\n  (\"React.js wrapper for CoffeeScript\", part library, part transformer)\n* [coffee-react](https://github.com/jsdf/coffee-react)\n  (JSX for CoffeeScript\n  (plus [related projects](https://github.com/jsdf/coffee-react#related-projects)))\n* [react-no-jsx](https://www.npmjs.com/package/react-no-jsx)\n  (uses arrays rather than function calls; not enough CoffeeScript)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1j01%2Freact-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1j01%2Freact-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1j01%2Freact-script/lists"}