{"id":15821401,"url":"https://github.com/mesaugat/swift-react","last_synced_at":"2025-05-08T16:55:42.869Z","repository":{"id":35162081,"uuid":"214809520","full_name":"mesaugat/swift-react","owner":"mesaugat","description":"Quick and dirty way to run React.","archived":false,"fork":false,"pushed_at":"2025-04-29T06:11:40.000Z","size":2136,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T16:55:32.041Z","etag":null,"topics":["hacktoberfest","react","react-dev","react-development","swift-react","webpack","webpack-dev-server"],"latest_commit_sha":null,"homepage":"https://yarn.pm/swift-react","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/mesaugat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2019-10-13T11:39:27.000Z","updated_at":"2025-04-29T06:11:37.000Z","dependencies_parsed_at":"2024-06-18T09:59:50.733Z","dependency_job_id":"077073c3-852e-4955-ae2b-264d728c3a10","html_url":"https://github.com/mesaugat/swift-react","commit_stats":{"total_commits":66,"total_committers":2,"mean_commits":33.0,"dds":"0.48484848484848486","last_synced_commit":"b0ab13dd69a1eac01a168983756b7b5ba4505f0c"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesaugat%2Fswift-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesaugat%2Fswift-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesaugat%2Fswift-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesaugat%2Fswift-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mesaugat","download_url":"https://codeload.github.com/mesaugat/swift-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253112074,"owners_count":21856070,"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":["hacktoberfest","react","react-dev","react-development","swift-react","webpack","webpack-dev-server"],"created_at":"2024-10-05T07:21:59.892Z","updated_at":"2025-05-08T16:55:42.830Z","avatar_url":"https://github.com/mesaugat.png","language":"JavaScript","readme":"# swift-react\n\n[![NPM Version](https://img.shields.io/npm/v/swift-react.svg?style=flat-square)](https://www.npmjs.com/package/swift-react)\n\n**Quick and dirty way to run React.**\n\n*Note: `swift-react` is strictly for development usage only and is helpful for quick prototyping and testing.*\n\n## Prerequisite\n\n* [npx](https://github.com/npm/npx)\n\n## Usage\n\nCreate an `index.js` file with a React component.\n\n```js\n// index.js\n\nfunction App() {\n  return (\n    \u003ch1\u003eHello swift-react\u003c/h1\u003e\n  );\n}\n\n// Caution: You don't need to import React or ReactDOM for swift-react to work.\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'));\n```\n\nFinally, run this command from the exact place where you created the `index.js` file.\n\n```bash\n$ npx swift-react\n```\n\nThis command will run a `webpack-dev-server` and serve your bundle.\n\n## Example\n\nNavigate to the [example directory](https://github.com/mesaugat/swift-react/tree/master/example) to see `swift-react` in action.\n\n## Usage with package.json\n\nAdd `swift-react` as a dev dependency.\n\n```bash\n$ yarn add swift-react --dev\n```\n\n```json\n// package.json\n\n{\n  \"name\": \"swift-react-example\",\n  \"scripts\": {\n    \"swift-react\": \"swift-react\"\n  },\n  \"devDependencies\": {\n    \"swift-react\": \"*\"\n  }\n}\n```\n\nNext, create an `index.js` file right next to your `package.json` file.\n\n```js\n// index.js\n\nfunction App() {\n  return (\n    \u003ch1\u003eHello swift-react\u003c/h1\u003e\n  );\n}\n\n// Caution: You don't need to import React or ReactDOM for swift-react to work.\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'));\n```\n\nFinally, run this command from the exact place where you created the `package.json` and `index.js` file.\n\n```bash\n$ yarn swift-react\n```\n\nThe advantage of this method as compared to the first one is that you don't have to download dependencies of `swift-react` time and again. It is great for offline usage.\n\n## Motivation\n\nSometimes testing a small React quirkiness is too cumbersome.\n\n## Caveats\n\n* The main js file should be named `index.js`.\n* The main component should be rendered to the `#root` DOM element.\n* You do not need to import `React` or `ReactDOM` as it is automatically loaded by webpack under the hood.\n* Works only with latest `React` and `ReactDOM` packages.\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmesaugat%2Fswift-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmesaugat%2Fswift-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmesaugat%2Fswift-react/lists"}