profile
viewpoint
Christopher Allen cpcallen Digital Routes Scotland Ltd., on assignment at @Google London, UK I'm a professional swing dance teacher moonlighting (daylighting?) as a software engineer on @google's engEDU Code City project.

NeilFraser/JS-Interpreter 1489

A sandboxed JavaScript interpreter in JavaScript.

google/blockly-games 1096

Games for tomorrow's programmers.

google/CodeCity 158

Google's Code City is a social programming environment. It offers a comic book inspired virtual world where programmers can write code collaboratively.

NeilFraser/JS-Polyfills 12

A collection of polyfills that recreate many functions in JavaScript's standard library.

cpcallen/old-new-tab 3

New Tab page for Google Chrome

NeilFraser/CodeCityHomepage 1

App Engine sources for Code City homepage.

cpcallen/.config 0

Personal dotfiles

cpcallen/Alligator 0

Application Server for JavaScript on top of NodeJS (AntiNode)

cpcallen/blockly 0

The web-based visual programming editor.

cpcallen/blockly-samples 0

Plugins, codelabs, and examples related to the Blockly library.

delete branch cpcallen/blockly

delete branch : migrate-blocks-math

delete time in 8 minutes

delete branch cpcallen/blockly

delete branch : migrate-blocks-variables

delete time in 13 minutes

push eventgoogle/blockly

Christopher Allen

commit sha 7d7bd75c3a42f98c6974b8ffb22eab386684ea1e

refactor: Migrate `blocks/variables.js` to `goog.module` syntax (#5774) * refactor: Migrate blocks/variables.js to goog.module * refactor: Migrate blocks/variables.js named requires * chore: clang-format blocks/variables.js * chore: JSDoc grammar correction

view details

push time in 13 minutes

push eventcpcallen/blockly

Christopher Allen

commit sha fa96b31f9c446f4891167b4d4bb4fcb64bef4438

chore: JSDoc grammar correction I bungled the rewording of these functions' descriptions.

view details

push time in 18 minutes

PR opened google/blockly

Reviewers
refactor: Migrate `blocks/variables.js` to `goog.module` syntax component: library blocks PR: chore

The basics

  • [X] I branched from develop
  • [X] My pull request is against develop
  • [X] My code follows the style guide
  • [X] My code is presented in the form suggested in the module conversion guide
  • [X] I have run npm test.

The details

Resolves

Part of #5597

Proposed Changes

Converts blocks/variables.js to goog.module with ES6 const/let.

Additional Information

<!-- Anything else we should know? -->

+70 -66

0 comment

3 changed files

pr created time in 26 minutes

create barnchcpcallen/blockly

branch : migrate-blocks-variables

created branch time in 29 minutes

issue commentgoogle/blockly

Advanced Playground broken (in `develop`)

  • This makes it so that the advanced playground will load however I get a new error:
Uncaught Error: Module Blockly.JavaScript has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. […]

This is expected since goog.modules can't be loaded with <script> tags. The advanced playground will need the same updates the regular playground got in #5715 and in #5721 (specifically, commit e6e39bd6).

Additional Information For some reason just running npm run start in dev-tools was not creating a dist folder so it was complaining when I tried to link. So I had to run npm run build for it to work. Just in case someone else runs into this.

As far as I know it is typical in the npm ecosystem to need to run npm build before npm start—though I think it also usual that packages are configured so that npm install runs npm build as well.

cpcallen

comment created time in an hour

PullRequestReviewEvent

delete branch cpcallen/blockly

delete branch : fix-msg

delete time in 3 hours

push eventgoogle/blockly

Christopher Allen

commit sha da16a66f33f063ce76af4e38857972f3e8f7f92f

refactor: msg.js: use named export, remove declareLegacyNamespace (#5768)

view details

push time in 3 hours

PR merged google/blockly

Reviewers
refactor: `core/msg.js`: use named export, remove `declareLegacyNamespace` cla: yes PR: chore

The basics

  • [X] I branched from develop
  • [X] My pull request is against develop
  • [X] My code follows the style guide

The details

Resolves

Fixes #5614. Fixes failures loading in uncompiled mode caused by PR #5757.

Proposed Changes

In core/msg.js:

  • Remove the goog.module.declareLegacyNamespace() call.
  • Use a null-prototype @type {!Object<string>} object as the messages dictionary, rather than using the Blockly.Msg exports object itself.
  • Export it as a named export.
  • Remove the translation-loading hack.

In core/blockly.js:

  • Re-export the messages dictionary as Blockly.Msg.
  • Provide a new, slightly more conservative granslation-loading hack.

Reason for Changes

See "Resolves", above.

Test Coverage

Passes npm test.

Tested on:

  • Desktop Chrome
+50 -34

3 comments

22 changed files

cpcallen

pr closed time in 3 hours

push eventcpcallen/blockly

Christopher Allen

commit sha ee185530358aec8ed6768d26c1dd730041827382

refactor: Migrate `blocks/text.js` to `goog.module` syntax (#5766) * refactor: Migrate blocks/text.js to goog.module * refactor: Migrate blocks/text.js named requires * refactor: Factor out common properties of text_prompt* blocks * clang-format blocks/text.js * fix: Fix lint warnings for PR #5766

view details

alschmiedt

commit sha 35279eb8b7c59febce5481fe77f8623604bacdd0

chore: correctly updates the compiled flag (#5767)

view details

Christopher Allen

commit sha f1c8e3155e590fcf3790a79e49d32187c7deeea1

Merge branch 'develop' into fix-msg Also update import of Blockly.Msg in blocks/text.js

view details

push time in 3 hours

pull request commentgoogle/blockly

refactor: `core/msg.js`: use named export, remove `declareLegacyNamespace`

Merging this after #5766 will break text blocks (due to import of Msg vs {Msg}). Will fix before merging.

cpcallen

comment created time in 3 hours

pull request commentgoogle/blockly

refactor: `core/msg.js`: use named export, remove `declareLegacyNamespace`

Merging this after #5766 will break text blocks (due to import of Msg vs {Msg}). Will fix before merging.

cpcallen

comment created time in 3 hours

pull request commentgoogle/blockly

Remove declare legacy serialization

To summarise the investigation of the test failures:

Until now, in uncompiled mode, modules were being loaded in the following (partial) order: Blockly.serialization.*, Blockly.Msg, Blockly:

  1. The declareLegacyNamespace calls in core/seralizaiton/*.js would create a global Blockly object (to put the Blockly.serialization namespace object on) and set the debug module loader's goog.implicitNamespace_['Blockly'] to true.
  2. The translation loading hack in core/msg.js would call .declareLegacyNamespace and add a .Msg property to Blockly, setting the value to that (Blockly.Msg) module's exports object.
  3. Having finished loading core/msg.js, the debug module loader would notice that .declareLegacyNamespace had been called and call goog.constructNamespace_('Blockly.Msg', …); constructNamespace_ would notice that a Blockly object already existed, so it would not try to (redundantly) set goog.implicitNamespace_['Blockly'] to true.
  4. The goog.module('Blockly') call in core/blockly.js would check goog.isProvided_('Blockly'), which would return false because although a Blockly object existed goog.implicitNamespace_['Blockly'] was true.

After @alschmiedt attempted to remove declareLegacyNamespace calls from core/serialization/*.js in this PR (#5757), there were no calls to this function before the one in core/msg.js, so what happened was:

  1. The translation loading hack in core/msg.js would call .declareLegacyNamespace **and create a Blockly object ** and add a .Msg property to it.
  2. Having finished loading core/msg.js, the debug module loader would notice that .declareLegacyNamespace had been called and call goog.constructNamespace_('Blockly.Msg', …); constructNamespace_ would notice that a Blockly object already existed, so it would not try to set goog.implicitNamespace_['Blockly'] to true.
  3. The goog.module('Blockly') call in core/blockly.js would check goog.isProvided_('Blockly'), which would return true because a Blockly object existed and goog.implicitNamespace_['Blockly'] was falsy (actually: undefiined), causing goog.module to throw.

I've therefore filed PR #5768, after which (but before PR #5757) what will happen will be:

  1. core/serialization/*.js will call declareLegacyNamespace; a Blockly object will be created (with .serialization property added) and goog.implicitNamespace_['Blockly'] will be set to true.
  2. core/msg.js will not call declareLegacyNamespace; it wile export a single null-prototype object as exports.Msg.
  3. core/blockly.js will call goog.module('Blockly'); the check for goog.isProvided_('Blockly') will succeed becausegoog.implicitNamespace_['Blockly']` is true.
  4. core/blockly.js will detect the existence of the Blockly object (because 'Blockly' in globalThis is true) and do nothing special.
  5. Having finished loading core/blockly.js, the debug module loader will call goog.exportPath_ with the overwriteImplicit flag set to false; this will result in properties from the exports object (including .Msg) being copied on to the Blockly object created earlier as usual.

After both #5768 and #5757 have been merged, what will happen will be:

  1. core/serialization/*.js will not call declareLegacyNamespace; goog.implicitNamespace_['Blockly'] will remain unset.
  2. core/msg.js will not call declareLegacyNamespace; it wile export a single null-prototype object as exports.Msg.
  3. core/blockly.js will call goog.module('Blockly'); the check for goog.isProvided_('Blockly') will succeed **because noBlockly` global variable is defined**.
  4. core/blockly.js will then detect that there is no 'Blockly' in globalThis and create a globalThis['Blockly'] = {Msg}.
  5. Having finished loading core/blockly.js, the debug module loader will call goog.exportPath_ with the overwriteImplicit flag set to false; this will result in properties from the exports object (including .Msg) being copied on to the Blockly object created earlier as usual; Blockly.Msg will get overwritten but with the same value it was set to in the previous step.
alschmiedt

comment created time in 7 hours

delete branch cpcallen/blockly

delete branch : migrate-blocks-text

delete time in 8 hours

push eventgoogle/blockly

Christopher Allen

commit sha ee185530358aec8ed6768d26c1dd730041827382

refactor: Migrate `blocks/text.js` to `goog.module` syntax (#5766) * refactor: Migrate blocks/text.js to goog.module * refactor: Migrate blocks/text.js named requires * refactor: Factor out common properties of text_prompt* blocks * clang-format blocks/text.js * fix: Fix lint warnings for PR #5766

view details

push time in 8 hours

PR merged google/blockly

refactor: Migrate `blocks/text.js` to `goog.module` syntax component: library blocks cla: yes PR: chore

<!-- refactor: Migrate blocks/FOOBAR.js to goog.module syntax -->

The basics

  • [X] I branched from develop
  • [X] My pull request is against develop
  • [X] My code follows the style guide
  • [X] My code is presented in the form suggested in the module conversion guide
  • [X] I have run npm test.

The details

Resolves

Part of #5597

Proposed Changes

Converts blocks/text.js to goog.module with ES6 const/let.

Additional Information

Have also done some common-property factoring as was done for Blockly.blocks.procedures in PR #5736.

+417 -410

1 comment

2 changed files

cpcallen

pr closed time in 8 hours

pull request commentgoogle/blockly

refactor: Migrate `blocks/text.js` to `goog.module` syntax

lgtm after you fix lint.

Weird that clang-format did not fix this.

cpcallen

comment created time in 8 hours

push eventcpcallen/blockly

Christopher Allen

commit sha a4f8aeaa13c5ddb72dc23710a399d9c85eed4b96

fix: Fix lint warnings for PR #5766

view details

push time in 8 hours

pull request commentgoogle/blockly

refactor: `core/msg.js`: use named export, remove `declareLegacyNamespace`

Cannot use 'in' operator to search for 'Blockly' in undefined 

with the offending line being

if (!('Blockly' in globalThis['Blockly'])) {

in blockly.js

You will know by now that I generally take the belt-and-braces approach but in this case it would appear that my trouser-fastenings have inadvertently become entangled.

The condition had originally been !globalThis['Blockly'] and had intended to change it to !('Blockly' in globalThis) but apparently I gave up half way through the edit. (Probably thinking too much about dinner.)

So it looks like the mocha tests are failing because Blockly.serialization.blocks and other serialization namespaces were undefined.

I added in my change from this PR to see if that would fix it. It seemed to fix that problem, but then runs into the error below:

I didn't touch the goog.module.declareLegacyNamespace calls in core/serialization/*.js in this PR, so I'm not quite sure what the problem is. Having fixed the error above I don't see any Mocha test failures locally or in CI.

cpcallen

comment created time in 9 hours

push eventcpcallen/blockly

Rachel Fenichel

commit sha a939fec53b05ee9acbc11f8a52c07e52e3d861ae

refactor: convert some block generators to goog.module (#5769) * refactor: convert generators/lua/colour.js to goog.module * refactor: convert generators/lua/colour.js to named requires * chore: run clang-format * refactor: convert generators/lua/lists.js to goog.module * refactor: convert generators/lua/lists.js to named requires * chore: run clang-format * fix: use getListIndex helper function in lua list generators * refactor: convert generators/lua/logic.js to goog.module * refactor: convert generators/lua/logic.js to named requires * chore: run clang-format * refactor: convert generators/lua/loops.js to goog.module * refactor: convert generators/lua/loops.js to named requires * chore: run clang-format * refactor: convert generators/lua/math.js to goog.module * refactor: convert generators/lua/math.js to named requires * chore: run clang-format * refcator: convert generators/lua/procedures.js to goog.module * refactor: convert generators/lua/procedures.js to named requires * chore: run clang-format * chore: rebuild deps.js * refactor: convert generators/lua/text.js to goog.module * refactor: convert generators/lua/text.js to named requires * refactor: convert generators/lua/variables_dynamic.js to goog.module * refactor: convert generators/lua/variables_dynamic.js to named requires * chore: run clang-format on text.js * refactor: convert generators/lua/variables.js to goog.module * refactor: convert generators/lua/variables.js to named requires * chore: run clang-format * chore: make a lua generator function internal * chore: rebuild deps.js

view details

Rachel Fenichel

commit sha c0517ea360fcf8cdb9ec9ad53af70cc4604accf9

refactor: convert some block generators to goog.module (#5770) * refactor: convert generators/lua.js to goog.module * refactor: convert generator/lua.js to named requires * chore: run clang-format * refactor: convert generators/php/colour.js to goog.module * refactor: convert generators/php/colour.js to named requires * chore: run clang-format * refactor: convert generators/php/lists.js to goog.module * refactor: convert generators/php/lists.js to named requires * chore: run clang-format * refactor: convert generators/php/logic.js to goog.module * refactor: convert generators/php/logic.js to named requires * chore: run clang-format * refactor: convert generators/php/loops.js to goog.module * refactor: convert generators/php/loops.js to named requires * chore: run clang-format * refactor: convert generators/php/math.js to goog.module * refactor: convert generators/php/math.js to named requires * chore: run clang-format * refactor: convert generators/php/procedures.js to goog.module * refactor: convert generators/php/procedures.js to named requires * chore: run clang-format * refactor: convert generators/php/text.js to goog.module * refactor: convert generators/php/text.js to named requires * chore: run clang-format * refactor: convert generators/php/variables.js to goog.module * refactor: convert generators/php/variables.js to named requires * chore: run clang-format * refactor: convert generators/php/variables_dynamic.js to goog.module * refactor: convert generators/php/variables_dynamic.js to named requires * refactor: convert generators/php.js to goog.module * refactor: convert generators/php.js to named requires * chore: run clang-format * chore: rebuild deps.js

view details

Rachel Fenichel

commit sha 931499295ee9bf55b9b5978e6ae21234fd87fc3c

refactor: convert python block generators to goog.module (#5771) * refactor: convert generators/python/colour.js to goog.module * refactor: convert generators/python/colour.js to named requires * chore: run clang-format * refactor: convert generators/python/lists.js to goog.module * refactor: convert generators/python/lists.js to named requires * chore: run clang-format * refactor: convert generators/python/logic.js to goog.module * refactor: convert generators/python/logic.js to named requires * chore: run clang-format * refactor: convert generators/python/loops.js to goog.module * refactor: convert generators/python/loops.js to named requires * chore: run clang-format * refactor: convert generators/python/math.js to goog.module * refactor: convert generators/python/math.js to named requires * chore: run clang-format * refactor: convert generators/python/procedures.js to goog.module * refactor: convert generators/python/procedures.js to named requires * chore: run clang-format * refactor: convert generators/python/text.js to goog.module * refactor: convert generators/python/text.js to named requires * chore: run clang-format * refactor: convert generators/python/variables_dynamic.js to named requires * refactor: convert generators/python/variables.js to named requires * chore: run clang-format * refactor: convert generators/python.js to goog.module * refactor: convert generators/python.js to named requires * chore: run clang-format * chore: remove spurious @private annotations * chore: rebuild

view details

Christopher Allen

commit sha 6e47624c9c8d45d29774e989ac278007e8c036f3

refactor: msg.js: use named export, remove declareLegacyNamespace Also move translation-loading hack to core/blockly.js to fix test failures for PR #5757.

view details

push time in 9 hours

PR opened google/blockly

Reviewers
refactor: `core/msg.js`: use named export, remove `declareLegacyNamespace` PR: chore

The basics

  • [X] I branched from develop
  • [X] My pull request is against develop
  • [X] My code follows the style guide

The details

Resolves

Fixes #5614. Fixes failures loading in uncompiled mode caused by PR #5757.

Proposed Changes

In core/msg.js:

  • Remove the goog.module.declareLegacyNamespace() call.
  • Use a null-prototype @type {!Object<string>} object as the messages dictionary, rather than using the Blockly.Msg exports object itself.
  • Export it as a named export.
  • Remove the translation-loading hack.

In core/blockly.js:

  • Re-export the messages dictionary as Blockly.Msg.
  • Provide a new, slightly more conservative granslation-loading hack.

Reason for Changes

See "Resolves", above.

Test Coverage

Passes npm test.

Tested on:

  • Desktop Chrome
+49 -33

0 comment

21 changed files

pr created time in a day

push eventcpcallen/blockly

Christopher Allen

commit sha 61207019b9924ddf3cfa1d418522470173d1bf4d

refactor: msg.js: use named export, remove declareLegacyNamespace Also move translation-loading hack to core/blockly.js to fix test failures for PR #5757.

view details

push time in a day

push eventcpcallen/blockly

Rachel Fenichel

commit sha 37a1e9725ce0fe192c23f66308892124415253fa

refactor: convert some block generators to goog.module (#5762) * refactor: convert generators/javascript.js to goog.module * refactor: convert generators/javascript.js to named requires * chore: run clang-format * refactor: convert generators/dart/variables.js to goog.module * refactor: convert generators/dart/variables.js to named requires * chore: run clang-format * refactor: convert generators/dart/variables_dynamic.js to goog.module * refactor: convert generators/dart/variables_dynamic.js to named requires * refactor: convert generators/dart/text.js to goog.module * refactor: convert generators/dart/text.js to named requires * chore: run clang-format * refactor: convert generators/dart/procedures.js to goog.module * refactor: convert generators/dart/procedures.js to named requires * chore: run clang-format * refactor: convert generators/dart/math.js to goog.module * refactor: convert generators/dart/math.js to named requires * chore: run clang-format * refactor: convert generators/dart/loops.js to goog.module * refactor: convert generators/dart/loops.js to named requires * chore: run clang-format * refactor: convert generators/dart/logic.js to goog.module * refactor: convert generators/dart/logic.js to named requires * chore: run clang-format * refactor: convert generators/dart/lists.js to goog.module * refactor: convert generators/dart/lists.js to named requires * chore: run clang-format * refactor: convert generators/dart/colour.js to goog.module * refactor: convert generators/dart/colour.js to named requires * chore: rebuild deps.js * chore: lint

view details

Christopher Allen

commit sha d7b82cddfc28683ee42b69e7e2a5b6d1e14bbe6d

refactor: Migrate `blocks/math.js` to `goog.module` syntax (#5765) * refactor: Migrate blocks/math.js to goog.module * refactor: Migrate blocks/math.js named requires * chore: clang-format blocks/math.js

view details

Christopher Allen

commit sha 13005ec551e4308fb64ba47c37f12a36edecef83

refactor: msg.js: use named export, remove declareLegacyNamespace Also move translation-loading hack to core/blockly.js to fix test failures for PR #5757.

view details

push time in a day

push eventgoogle/blockly

Christopher Allen

commit sha d7b82cddfc28683ee42b69e7e2a5b6d1e14bbe6d

refactor: Migrate `blocks/math.js` to `goog.module` syntax (#5765) * refactor: Migrate blocks/math.js to goog.module * refactor: Migrate blocks/math.js named requires * chore: clang-format blocks/math.js

view details

push time in a day

PR merged google/blockly

refactor: Migrate `blocks/math.js` to `goog.module` syntax component: library blocks cla: yes PR: chore

The basics

  • [X] I branched from develop
  • [X] My pull request is against develop
  • [X] My code follows the style guide
  • [X] My code is presented in the form suggested in the module conversion guide
  • [X] I have run npm test.

The details

Resolves

Part of #5597

Proposed Changes

Converts blocks/math.js to goog.module with ES6 const/let.

Additional Information

<!-- Anything else we should know? -->

+281 -279

0 comment

3 changed files

cpcallen

pr closed time in a day

create barnchcpcallen/blockly

branch : fix-msg

created branch time in a day

PR opened google/blockly

Reviewers
refactor: Migrate `blocks/text.js` to `goog.module` syntax component: library blocks PR: chore

<!-- refactor: Migrate blocks/FOOBAR.js to goog.module syntax -->

The basics

  • [X] I branched from develop
  • [X] My pull request is against develop
  • [X] My code follows the style guide
  • [X] My code is presented in the form suggested in the module conversion guide
  • [X] I have run npm test.

The details

Resolves

Part of #5597

Proposed Changes

Converts blocks/text.js to goog.module with ES6 const/let.

Additional Information

Have also done some common-property factoring as was done for Blockly.blocks.procedures in PR #5736.

+417 -410

0 comment

2 changed files

pr created time in a day

create barnchcpcallen/blockly

branch : migrate-blocks-text

created branch time in a day

more