Skip to content

Conversation

@rachel-fenichel
Copy link
Collaborator

@rachel-fenichel rachel-fenichel commented Feb 19, 2021

The basics

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

The details

Resolves

Resolves some dependency issues.

Proposed Changes

Moves three functions and one typedef onto a newly created namespace:

  • Blockly.bindEvent_ -> Blockly.browserEvents.bind
  • Blockly.unbindEvent_ -> Blockly.browserEvents.unbind
  • Blockly.bindEventWithChecks_ -> Blockly.browserEvents.conditionalBind
  • Blockly.EventData -> Blockly.browserEvents.Data

For backwards compatibility, I left aliases in blockly.js for these three functions. I plan to move all internal uses to the fully qualified name.

Behavior Change?

No change in behaviour

Reason for Changes

We have circular dependecies because blockly.js requires most parts of blockly (workspaces, etc) but defines key utility functions that are used throughout the codebase.

The functions are used all over the place and only require one thing (Blockly.Touch). Moving the functions to their own namespace allows users to require them directly, rather than requiring the whole of Blockly.

Documentation

Additional Information

This is a sample to show what the change will look like. I'd like to nail down names for the namespace and function before I change all of the uses.

@rachel-fenichel
Copy link
Collaborator Author

@maribethb I've updated the names and comments, PTAL

…d missing requires for Blockly.browserEvents.
@rachel-fenichel rachel-fenichel merged commit 0b09d17 into RaspberryPiFoundation:develop Feb 25, 2021
@rachel-fenichel rachel-fenichel deleted the event_data_type branch February 25, 2021 20:00
@cpcallen cpcallen mentioned this pull request Sep 3, 2021
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants