{"id":14483675,"url":"https://github.com/nbudin/react-blockly","last_synced_at":"2026-02-20T19:16:04.062Z","repository":{"id":35061748,"uuid":"202164216","full_name":"nbudin/react-blockly","owner":"nbudin","description":"A React component that embeds a Blockly visual programming editor.","archived":false,"fork":false,"pushed_at":"2024-11-19T12:18:57.000Z","size":5554,"stargazers_count":293,"open_issues_count":20,"forks_count":74,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-08-30T04:36:22.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nbudin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"tidelift":"npm/react-blockly"}},"created_at":"2019-08-13T14:40:23.000Z","updated_at":"2025-08-18T01:11:20.000Z","dependencies_parsed_at":"2024-05-02T02:51:23.860Z","dependency_job_id":"eb973a8d-1f94-4907-a39f-b25de9fdb45c","html_url":"https://github.com/nbudin/react-blockly","commit_stats":{"total_commits":226,"total_committers":26,"mean_commits":8.692307692307692,"dds":0.7256637168141593,"last_synced_commit":"b5529796e0a9712d3a1201ea828c9bbac6b130d2"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/nbudin/react-blockly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbudin%2Freact-blockly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbudin%2Freact-blockly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbudin%2Freact-blockly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbudin%2Freact-blockly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbudin","download_url":"https://codeload.github.com/nbudin/react-blockly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbudin%2Freact-blockly/sbom","scorecard":{"id":677216,"data":{"date":"2025-08-11","repo":{"name":"github.com/nbudin/react-blockly","commit":"ac7c788a388ef608dde69b4d03ac7e42d9f48bef"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 2/8 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/nbudin/react-blockly/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/nbudin/react-blockly/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/nbudin/react-blockly/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/nbudin/react-blockly/ci.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"39 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T21:53:52.406Z","repository_id":35061748,"created_at":"2025-08-21T21:53:52.406Z","updated_at":"2025-08-21T21:53:52.406Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29661589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-09-03T00:01:58.787Z","updated_at":"2026-02-20T19:16:04.032Z","avatar_url":"https://github.com/nbudin.png","language":"TypeScript","funding_links":["https://tidelift.com/funding/github/npm/react-blockly"],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-blockly\n\n[![Built on Blockly](https://tinyurl.com/built-on-blockly)](https://github.com/google/blockly)\n\nA React library for embedding [Blockly](https://developers.google.com/blockly/), the visual programming editor from Google.\n\nThis is a continuation of PatientsLikeMe's [react-blockly-component](https://github.com/patientslikeme/react-blockly-component) project.  This new version utilizes Google's official Blockly npm packages in addition to other modernizations.\n\nFeatures:\n\n* Provides a hook as well as a function component for ease of use + flexibility\n* Supports the JSON toolbox format\n* Automatically propagates prop updates to Blockly\n* Provides callbacks for workspace injection, disposal, changes, and XML import errors\n* Automatically generates workspace XML, debounced for performance\n\n## VERSION 7 IS A COMPLETE REWRITE\n\nThis is the README for react-blockly version 7.  If you're using the old class-based components, you will want to look at the version 6 readme instead: https://github.com/nbudin/react-blockly/blob/v6-stable/README.md\n\nThe breaking changes in react-blockly 7 are:\n\n* All components except BlocklyWorkspace have been removed\n* A hook for embedding Blockly in custom DOM has been added\n* The custom JSON format for toolbox has been removed in favor of Blockly's official toolbox JSON format\n* React 16.8 or higher is required\n* immutable.js has been removed\n\n## Example usage\n\n[FernandoVazZ](https://github.com/FernandoVazZ) has made an example React app that shows how to set up react-blockly as well as how to create custom blocks for use in it: https://github.com/FernandoVazZ/reactblockly-customblocks/\n\nThanks so much Fernando!\n\n## Help wanted!\n\nI wrote react-blockly for an internal tool when I worked at PatientsLikeMe, Inc.  I no longer maintain this tool, and I don't even have access to it anymore.  I also don't have any actual project that uses react-blockly anymore.\n\nI'd love to find maintainers for this package who actually use it.  In particular, some things I would love to have help with are:\n\n* A test suite\n* Better documentation\n* More examples\n\nIf you are interested in working on any of those things, please [let me know](mailto:natbudin@gmail.com)!  Additionally, if you're interested in taking over maintainership of this package entirely, I'd be happy to talk to you about that.\n\n## Installation\n\nTo add react-blockly to a React app that uses npm, run:\n\n```bash\nnpm install --save react-blockly\n```\n\nTo add react-blockly to a React app that uses yarn, run:\n\n```bash\nyarn add react-blockly\n```\n\n## How to use\n\nYou can use react-blockly as either a component or a hook.  Embedding a component is often more\nstraightforward and plugs into your app easily.  On the other hand, using the hook can give you\nmore control over exactly how Blockly is rendered.\n\n### Embedding a component\n\nWrite `import { BlocklyWorkspace } from 'react-blockly';` in your code and use BlocklyWorkspace as a component.\n\nExample:\n\n```jsx\nimport { BlocklyWorkspace } from 'react-blockly';\n\nfunction MyBlocklyEditor() {\n  const [xml, setXml] = useState();\n\n  return (\n    \u003cBlocklyWorkspace\n      className=\"width-100\" // you can use whatever classes are appropriate for your app's CSS\n      toolboxConfiguration={MY_TOOLBOX} // this must be a JSON toolbox definition\n      initialXml={xml}\n      onXmlChange={setXml}\n    /\u003e\n  )\n}\n```\n\n### Using the hook\n\nWrite `import { useBlocklyWorkspace } from 'react-blockly';` in your code and use this hook to inject a Blockly workspace into your rendered components.\n\nExample:\n\n```jsx\nimport { useBlocklyWorkspace } from 'react-blockly';\n\nfunction MyBlocklyHookEmbed() {\n  const blocklyRef = useRef(null);\n  const { workspace, xml } = useBlocklyWorkspace({\n    ref: blocklyRef,\n    toolboxConfiguration: MY_TOOLBOX, // this must be a JSON toolbox definition\n    initialXml: xml,\n  });\n\n  return (\n    \u003cdiv ref={blocklyRef} /\u003e // Blockly will be injected here\n  )\n}\n```\n\n## API reference\n\n### BlocklyWorkspace component props\n\nAll properties are optional.\n\n* `initialXml`: The XML of the program to initially load in the editor.\n* `workspaceConfiguration`: Any configuration options to be passed into `Blockly.inject` (except for `toolbox`, which is a separate prop).\n* `toolboxConfiguration`: A JSON toolbox configuration (see [the Blockly documentation](https://developers.google.com/blockly/guides/configure/web/toolbox#json) for details on this format).\n* `className`: The value for the `class` attribute to be used on the `\u003cdiv\u003e` elements generated by this component.  Typically you'll need to use this to set the height of the Blockly editor, using either an explicit `height` style, flexboxes, or some other means.\n* `onWorkspaceChange`: A function called every time the content of the workspace changes.  It should take a single argument, which is the Blockly workspace object.  (You can call methods such as Blockly.JavaScript.workspaceToCode on this object.)\n* `onXmlChange`: A function called every time the content of the workspace, debounced to be called at most once every 200 milliseconds.  This function should take a single argument, which is the new XML generated from the workspace.\n* `onImportXmlError`: A function called if `initialXml` can't be imported.  This function takes a single argument, which is the error thrown during XML import.\n* `onInject`: A function called after the Blockly workspace is injected.  This function takes a single argument, which is the newly-injected Blockly workspace object.  This is a good place to add Blockly plugins, if desired.\n* `onDispose`: A function called after the Blockly workspace is disposed and removed from the page.  This function takes a single argument, which is the just-disposed Blockly workspace object.  Some Blockly plugins need to use this to dispose their own resources.\n\n### useBlocklyWorkspace\n\n`useBlocklyWorkspace(options) -\u003e { workspace, xml }`;\n\n#### Options object\n\nAll properties are optional, except `ref`, which must be passed.\n\n* `ref`: **REQUIRED** A React ref object (created via `useRef`) pointing at an HTML element where Blockly will be injected.\n* `initialXml`: The XML of the program to initially load in the editor.\n* `workspaceConfiguration`: Any configuration options to be passed into `Blockly.inject` (except for `toolbox`, which is a separate prop).\n* `toolboxConfiguration`: A JSON toolbox configuration (see [the Blockly documentation](https://developers.google.com/blockly/guides/configure/web/toolbox#json) for details on this format).\n* `onWorkspaceChange`: A function called every time the content of the workspace changes.  It should take a single argument, which is the Blockly workspace object.  (You can call methods such as Blockly.JavaScript.workspaceToCode on this object.)\n* `onImportXmlError`: A function called if `initialXml` can't be imported.  This function takes a single argument, which is the error thrown during XML import.\n* `onInject`: A function called after the Blockly workspace is injected.  This function takes a single argument, which is the newly-injected Blockly workspace object.  This is a good place to add Blockly plugins, if desired.\n* `onDispose`: A function called after the Blockly workspace is disposed and removed from the page.  This function takes a single argument, which is the just-disposed Blockly workspace object.  Some Blockly plugins need to use this to dispose their own resources.\n\n#### Hook return value\n\n`useBlocklyWorkspace` returns an object containing:\n\n* `workspace`: The Blockly workspace object\n* `xml`: XML generated from the content of the Blockly workspace, debounced to update at most once every 200 milliseconds\n\n## Developer setup for working on this package\n\nClone this repository, and then inside it, do:\n\n```bash\nyarn install\nyarn run start\n```\n\nwebpack-dev-server will start and will be serving a demo of react-blockly, which should automatically refresh if you change the code locally.\n\n## Example usage\n\nSee `public/index.html` and `src/dev-index.jsx` for a fairly full-fledged demo that shows off most of the features of this component.\n\n## Contributing\n\nWe accept pull requests and issues!  You can file an issue on this project, or fork, modify, and file a pull request.\n\nPlease note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.\n\n## Licensing\n\nreact-blockly is Copyright \u0026copy; 2019-2021 Nat Budin.  Distributed under the terms and conditions of the MIT License.\n\nreact-blockly is based on react-blockly-component, which is Copyright \u0026copy; 2015 PatientsLikeMe, Inc.  Distributed under the terms and conditions of the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbudin%2Freact-blockly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbudin%2Freact-blockly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbudin%2Freact-blockly/lists"}