{"id":28201085,"url":"https://github.com/leonvogt/hotwire-native-dev-tools","last_synced_at":"2025-06-12T18:31:26.342Z","repository":{"id":290728213,"uuid":"913035717","full_name":"leonvogt/hotwire-native-dev-tools","owner":"leonvogt","description":"A lightweight dev tool to debug and inspect Hotwire Native apps, right from your mobile app","archived":false,"fork":false,"pushed_at":"2025-05-26T19:20:17.000Z","size":123,"stargazers_count":38,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T23:45:31.510Z","etag":null,"topics":["hotwire-native"],"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/leonvogt.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,"zenodo":null}},"created_at":"2025-01-06T22:42:03.000Z","updated_at":"2025-06-03T13:23:22.000Z","dependencies_parsed_at":"2025-04-30T09:22:18.081Z","dependency_job_id":null,"html_url":"https://github.com/leonvogt/hotwire-native-dev-tools","commit_stats":null,"previous_names":["leonvogt/hotwire-native-dev-tools"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/leonvogt/hotwire-native-dev-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonvogt%2Fhotwire-native-dev-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonvogt%2Fhotwire-native-dev-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonvogt%2Fhotwire-native-dev-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonvogt%2Fhotwire-native-dev-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonvogt","download_url":"https://codeload.github.com/leonvogt/hotwire-native-dev-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonvogt%2Fhotwire-native-dev-tools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519177,"owners_count":22870324,"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":["hotwire-native"],"created_at":"2025-05-16T22:15:35.987Z","updated_at":"2025-06-12T18:31:26.331Z","avatar_url":"https://github.com/leonvogt.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eHotwire Native Dev Tools\u003c/h1\u003e\n\n![hotwire_native_dev_tools_preview](https://res.cloudinary.com/dlvuixik3/image/upload/v1745771546/hotwire_native_dev_tools_preview_xcnjhw.png)\n\n\nHotwire Native Dev Tools aims to support the development process of Hotwire Native apps by providing a set of tools to inspect and debug the app. \n\n- 🔍 Inspect the bridge communication and native stack\n- 🪵 View console logs right in the mobile app\n- ⚠️ Detect common Turbo issues\n- 📦 No dependencies\n\n## Installation\n\n```bash\nnpm install hotwire-native-dev-tools\n```\nor\n\n```bash\nyarn add hotwire-native-dev-tools\n```\n\n## Usage (JS)\n\n**Basic usage:**\n```js\nimport { setupDevTools } from 'hotwire-native-dev-tools';\nsetupDevTools();\n```\n\nHowever, since you probably want to use the dev tools only during mobile app development, **the recommended approach is to create a custom entrypoint** that you load only when needed:\n\n**Example Rails + Vite:**\n\n```js\n// app/javascript/entrypoints/hotwire_native_dev_tools.js\n\nimport { setupDevTools } from 'hotwire-native-dev-tools';\nsetupDevTools();\n```\n\n```erb\n// layout/application.html.erb\n\n\u003chead\u003e\n  \u003c%= vite_javascript_tag \"hotwire_native_dev_tools\" if Rails.env.development? \u0026\u0026 hotwire_native_app? %\u003e\n\u003c/head\u003e\n```\n\n**Tip**: Place the `vite_javascript_tag` early to capture all console logs and messages.\nThis way, you'll minimize the chances of missing console logs or bridge messages that are sent before the dev tools are initialized.\n\n--- \n\n**Example Rails + Importmap:**\n\n```rb\npin \"hotwire-native-dev-tools\"\npin \"dev-tools\", preload: false\n```\n\n```js\n// app/javascript/dev-tools.js\n\nimport { setupDevTools } from 'hotwire-native-dev-tools';\nsetupDevTools();\n```\n\n```erb\n// layout/application.html.erb\n\n\u003chead\u003e\n  \u003c%= javascript_importmap_tags %\u003e\n  \u003c%= javascript_import_module_tag \"dev-tools\" if Rails.env.development? \u0026\u0026 hotwire_native_app? %\u003e\n\u003c/head\u003e\n```\n\n---\n\nAlternatively, if you prefer not to create a custom entrypoint, you can use a JavaScript condition to determine whether the dev tools should be loaded:\n```js\nimport { setupDevTools } from 'hotwire-native-dev-tools';\nconst isDev = process.env.NODE_ENV === 'development';\nsetupDevTools({\n  enabled: isDev,\n});\n```\n\nPlease note that your JS condition may vary depending on your setup and needs.     \nThe downside of this approach is that you ship the JS code of the dev tools to the client, even if the client is not in development mode.    \nThis dev tools package is quite small (~15kb), but if you want to avoid shipping unnecessary code to the client, you should use the custom entrypoint approach.    \n\n## Usage (Native)\n\nSome features, such as the Native Stack and PathConfiguration properties, are only available if you add the dev tool bridge components to your app:\n\n### iOS\n\n1. Copy the Swift file [DevToolsComponent.swift](https://github.com/leonvogt/hotwire-native-dev-tools/blob/main/ios/DevToolsComponent.swift) into your Xcode project\n2. Register the component\n\n```diff\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n        Hotwire.registerBridgeComponents([\n+            DevToolsComponent.self\n        ])\n        return true\n    }\n}\n```\n\n### Android\n\n1. Copy the Kotlin file [DevToolsComponent.kt](https://github.com/leonvogt/hotwire-native-dev-tools/blob/main/android/DevToolsComponent.kt) into your Android Studio project\n2. Update the package names where the comments say `// Replace with your package name`\n3. Register the component\n\n```diff\n+ import replace.with.your.package.name.DevToolsComponent\n\nclass DemoApplication : Application() {\n    override fun onCreate() {\n        super.onCreate()\n\n        Hotwire.registerBridgeComponents(\n+            BridgeComponentFactory(\"dev-tools\", ::DevToolsComponent),\n        )\n    }\n}\n```\n\n## Development\n\n- Fork the project locally\n- `npm install`\n- `npm run dev`\n\n**Setting Up the Package Locally**     \nOne way to link the package locally is to use `yarn link`.     \nThis allows you to develop the package and test it in another project.   \n\nIn the root of this project run:\n```bash\nyarn link\n```\n\nIn the project you want to use the package run:\n```bash\nyarn link hotwire-native-dev-tools\n```\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/leonvogt/hotwire-native-dev-tools.     \nAny contributions, whether it's a bug fix, a new feature, or just a suggestion for improvement, are most welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonvogt%2Fhotwire-native-dev-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonvogt%2Fhotwire-native-dev-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonvogt%2Fhotwire-native-dev-tools/lists"}