Commit Graph

56 Commits

Author SHA1 Message Date
Beka Westberg 53f1b9aed3 Add JSO hooks for blocks and fields. (#5052)
* Add JSON serialiation hooks for fields

* Add checking for JSON hooks

* Fix other checks and move checks to function

* Remove error for both serialization hooks being defined

* Fixup comments and errors

* Add tests

* Add json hooks to block properties

* Cleanup

* Rip out fragile backwards compatibility
2021-09-20 10:32:09 -07:00
kozbial ee53e8e812 Update optional requires 2021-08-10 11:18:38 -07:00
Monica Kozbial bec82da358 Remove require destructuring (#5294) 2021-08-03 15:07:14 -07:00
Aaron Dodson 0e6258ca1a Migrated to inline exports 2021-07-21 08:17:13 -07:00
kozbial fa9a175296 Update name of private property 2021-07-16 10:46:04 -07:00
kozbial 9ba9627ed1 clang-format core/extensions.js 2021-07-16 10:46:04 -07:00
kozbial 0bd678fe55 Migrate core/extensions.js named requires 2021-07-16 10:46:04 -07:00
kozbial fed47362cd Migrate core/extensions.js to goog.module 2021-07-16 10:46:04 -07:00
kozbial 6dcc24901c Migrate core/extensions.js to ES6 const/let 2021-07-16 10:46:04 -07:00
Neil Fraser 861a981cb6 Remove extra else clauses 2021-06-09 11:41:42 -07:00
Neil Fraser 76b5517008 Use null-prototype objects for maps
A {} has a bunch of names already defined on it (like ‘toString’).  When using an object as a map with arbitrary keys, it should not inherit from Object.prototype.
2021-06-09 11:41:42 -07:00
Neil Fraser d919b0af21 Update JSDoc from Array.<> to Array<>
Same with Object.
2021-05-27 21:30:26 -07:00
Rachel Fenichel 26d2b51681 Fix missing require types 2021-02-17 11:17:48 -08:00
Jakub Vrána 00bb99e0ff Add non-nullable modifier to return type of functions never returning null (#3742) 2020-03-16 08:14:47 -07:00
Neil Fraser 4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini 759875a6c0 Resolve remaining compiler type warnings (#3334)
* Resolve remaining compiler warnings with inconsistent types.
2019-10-25 19:07:17 -04:00
Sam El-Husseini d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -07:00
Neil Fraser b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Neil Fraser 4ed3295ad9 Make generator an optional module (#3105) 2019-09-27 10:47:10 -07:00
Monica Kozbial 22e79ae496 Updating behavior of register functions and adding unregister. (#3085)
* Updating behavior of register functions and adding unregister.

* Updates jsdoc comments.
2019-09-26 13:23:45 -07:00
Neil Fraser 84a814cda1 Make mutator an optional module. (#3048) 2019-09-19 11:39:55 -07:00
Neil Fraser 9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser 25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -07:00
Neil Fraser e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Neil Fraser 405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Neil Fraser aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Neil Fraser dddb94aedd Fix circular dependency. 2018-10-16 11:34:10 -07:00
Neil Fraser 3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Andrew n marshall f45c6faf05 Fix #1619. buildTooltipWithFieldValue() => buildTooltipWithFieldText() (#1638)
Fix #1619. buildTooltipWithFieldValue() => buildTooltipWithFieldText()

The "value" of FieldVariables was the variable id.
However, we usually want the field text for the human visible tooltip.
Refactoring and renaming buildTooltipWithFieldValue to use the field
text.
2018-02-16 16:51:18 -08:00
Rachel Fenichel 3e62ffc20a Split at higher level for multiline function calls 2018-01-24 11:26:41 -08:00
Rachel Fenichel 9a53e96d53 More lint fixes 2018-01-23 18:22:53 -08:00
Neil Fraser 870f7b7f8a Fix document detection.
Andrew LGTMs in person.
2018-01-08 15:10:14 -08:00
duzc2dtw@gmail.com da429688f8 space between if and ( 2017-12-13 17:02:34 +08:00
duzc2dtw@gmail.com 26ea42c264 #1376 2017-12-09 20:41:43 +08:00
duzc2dtw@gmail.com 0ee877b4bf fix indent 2017-12-09 02:09:58 +08:00
duzc2dtw@gmail.com f770b29491 fix #1173 2017-12-09 02:03:28 +08:00
Neil Fraser 2445a752b7 Resolve another 20 warnings. 2017-10-24 14:06:29 -07:00
Neil Fraser 4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Neil Fraser 631c978174 Fix typos. 2017-10-20 13:29:23 -07:00
Rachel Fenichel 078b4fceb3 Revert some whitespace changes to appease eslint (#1370) 2017-10-19 16:08:54 -07:00
Neil Fraser 5c00256e96 Style improvements. No functional changes. (#1367) 2017-10-17 15:19:50 -07:00
RoboErikG 26e74f72d6 Missed one use of string instead of .property in extensions.js (#1262) 2017-08-04 11:34:33 -07:00
RoboErikG fab59facee Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS (#1253)
* Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS

We were using strings to check for the existence of properties on
a mutator, which breaks if those properties were renamed by the
closure compiler. This updates all of the uses to direct function
references so that anyone building with advanced optimizations turned
on will get the correct method references in their mutators.

fixes #1251

* Update to extensions.js for advanced optimizations

Some minor updates to making extensions.js work with advanced
optimizations.

* use === undefined instead of typeof == 'undefined'
2017-08-03 15:18:41 -07:00
Neil Fraser fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
Rachel Fenichel c30928a177 Make some functions private and add tests 2017-02-24 15:51:59 -08:00
Rachel Fenichel aa8e996799 Handle mutations with both mixins and functions 2017-02-23 17:07:06 -08:00
Rachel Fenichel 4b0c32e91f Add safety checks for mutators and non-mutator extensions 2017-02-23 15:55:13 -08:00
Rachel Fenichel 455432250e Use mutator extension for controls_if block 2017-02-22 17:05:52 -08:00
Andrew n marshall a4cfd5cbc8 Porting Loop blocks to JSON (#919)
* Improved documentation on `Blockly.Extensions.buildTooltipForDropdown`
 * Replaced incorrect uses of `@mixes` JSDoc annotation (on mixin extensions) with `@augments Blockly.Block`.
 * Added Blockly.Extensions.buildTooltipWithFieldValue() extension helper.
2017-02-08 11:36:38 -08:00
Andrew n marshall 15827c5d30 Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin(). (#907)
Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin().
This adds support for a common use pattern in extensions, and adds
error checking to avoid future incompatibilities.
2017-02-06 10:00:08 -08:00