Contribute to core
Stay organized with collections
Save and categorize content based on your preferences.
The Blockly core repository contains the
code that is needed to run any Blockly-based application.
Need to Know
Here is a quick overview of facts about Blockly core you need to know in order
to create a PR.
Make and Verify a Change
- Run
npm install
to install dependencies.
- Run
npm run start
to start up a server running the playground. You can use
this page to test the existing behavior. See the
playground page for
more information.
- Make any necessary changes to the code.
- If you've left the server running, refresh to see your changes. Otherwise,
restart the server and verify the code behaves as expected and there are no
errors or warnings in the console.
- Run
npm run build
and ensure there are no build errors.
- Write automated tests. Usually, these will be mocha tests in the
tests/mocha
directory, but we may ask you for other types of tests.
- Run
npm run format
to format the code and automatically fix some lint
problems.
- Run
npm test
to run the automated tests. This also runs eslint
.
- If there are lint errors, run
npm run lint:fix
to fix the problems that
are autofixable. Address any remaining lint warnings or errors.
- If all tests pass, you are ready to open a PR against develop with your
changes.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-23 UTC."],[[["\u003cp\u003eBlockly core is the foundation for any Blockly-based application and uses the 'develop' branch for contributions.\u003c/p\u003e\n"],["\u003cp\u003eContributors must adhere to Google's TypeScript Style Guide, use conventional commits, and ensure all user-facing strings are translatable.\u003c/p\u003e\n"],["\u003cp\u003eBackwards compatibility is crucial to avoid breaking existing Blockly applications, and new code files must include the Apache License v2.0 header.\u003c/p\u003e\n"],["\u003cp\u003eThe development process involves running local tests, building the project, writing automated tests, and addressing any lint errors before submitting a pull request.\u003c/p\u003e\n"]]],[],null,["# Contribute to core\n\nThe [Blockly](https://github.com/google/blockly) core repository contains the\ncode that is needed to run any Blockly-based application.\n\nNeed to Know\n------------\n\nHere is a quick overview of facts about Blockly core you need to know in order\nto create a PR.\n\n- The working branch is **develop** and all PRs should be made against develop.\n- You must fill out the pull request template with the requested information.\n- Code must conform to Google's [TypeScript Style\n Guide](https://google.github.io/styleguide/tsguide.html).\n- Use [conventional commits](/blockly/guides/contribute/get-started/commits) in your commit messages and pull request titles.\n- User-visible strings must be in the `/msg/messages.js` file so they may be translated. Less than 6% of the world speaks English natively.\n- Text on blocks should generally be all lowercase (just like the keywords in most programming languages).\n- Maintain backwards compatibility. There are a *lot* of Blockly apps out there, don't break everyone else.\n- Any new code files must be prefixed with the Apache License v2.0:\n\n /**\n * @license\n * Copyright \u003cCurrent YYYY\u003e Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nMake and Verify a Change\n------------------------\n\n1. Run `npm install` to install dependencies.\n2. Run `npm run start` to start up a server running the playground. You can use this page to test the existing behavior. See the [playground](/blockly/guides/contribute/get-started/playground) page for more information.\n3. Make any necessary changes to the code.\n4. If you've left the server running, refresh to see your changes. Otherwise, restart the server and verify the code behaves as expected and there are no errors or warnings in the console.\n5. Run `npm run build` and ensure there are no build errors.\n6. Write automated tests. Usually, these will be mocha tests in the `tests/mocha` directory, but we may ask you for other types of tests.\n7. Run `npm run format` to format the code and automatically fix some lint problems.\n8. Run `npm test` to run the automated tests. This also runs `eslint`.\n9. If there are lint errors, run `npm run lint:fix` to fix the problems that are autofixable. Address any remaining lint warnings or errors.\n10. If all tests pass, you are ready to open a PR against **develop** with your changes."]]