{"id":17275303,"url":"https://github.com/jflinter/blackbox","last_synced_at":"2025-06-25T22:03:03.691Z","repository":{"id":145373142,"uuid":"176010967","full_name":"jflinter/BlackBox","owner":"jflinter","description":"Yet Another Magical JS/ObjC Bridge","archived":false,"fork":false,"pushed_at":"2019-03-16T19:02:27.000Z","size":306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T22:02:51.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/jflinter.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-16T18:41:48.000Z","updated_at":"2019-03-16T19:02:29.000Z","dependencies_parsed_at":"2023-03-28T01:02:10.748Z","dependency_job_id":null,"html_url":"https://github.com/jflinter/BlackBox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jflinter/BlackBox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflinter%2FBlackBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflinter%2FBlackBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflinter%2FBlackBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflinter%2FBlackBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jflinter","download_url":"https://codeload.github.com/jflinter/BlackBox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflinter%2FBlackBox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960492,"owners_count":23236570,"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-10-15T08:55:53.786Z","updated_at":"2025-06-25T22:03:03.682Z","avatar_url":"https://github.com/jflinter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlackBox\nThis is an experiment with using protobuf to define a JS/native code interface such that one can write business logic for a native app in JavaScript. It's either a really bad idea or a really good idea.\n\n## Getting started\n```bash\nbrew install protoc carthage\ncd js \u0026\u0026 npm install\ncd ../ios \u0026\u0026 carthage update\nopen BlackBox.xcodeproj\n# build \u0026 run the iOS app\n```\n\n## How this works\nThe `js` folder contains a simple JS redux app (in index.js). Notably, the structure of that app's state, as well as all of the actions that can be dispacthed into the store, is predefined in `blackbox.proto`.\n\n\nRunning webpack on that app (`npm run-script build`) produces `dist/main.js`, which is bundled into the iOS app (whose source is in the `ios` directory).\n\nThe iOS app loads this JS module inside a `JSContext` - somewhat like a node environment. Any functions that are exported in `index.js` can be referenced inside `JavaScript.swift` via the `getHooksFunc` function.\n\nState is handed back and forth between the `JSContext` and the iOS app as serialized proto. `BBArrayConverter` handles this conversion.\n\nBy calling `JavaScript.addStateCallback`, one can effectively subscribe to changes to the redux store, but in swift.\n\nBy calling `JavaScript.handleAction`, one can dispatch actions into the redux store (again, in swift).\n\n## Making changes\n- If you make changes to the proto, re-run `proto.sh`. If you make changes to the JS, re-run `npm run-script build`. (Both of these commands are run automatically via Run Script Build Phase when you run the iOS app.)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjflinter%2Fblackbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjflinter%2Fblackbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjflinter%2Fblackbox/lists"}