From f947b3f4f669660faf46dd82c374e893b7f9acce Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 30 Jun 2022 19:53:32 +0100 Subject: [PATCH] refactor!: Remove remaining use of `goog.module.declareLegacyNamespace`. (#6254) * fix(build): Minor corrections to build_tasks.js - Use TSC_OUTPUT_DIR to find goog/goog.js when suppressing warnings. - Remove unnecessary trailing semicolons. * refactor(blocks): Remove declareLegacyNamespace Remove the call to goog.module.declareLegacyNamespace from Blockly.libraryBlocks. This entails: - Changes to the UMD wrapper to be able to find the exports object. - Changes to tests/bootstrap_helper.js to save the exports object in the libraryBlocks global variable. - As a precaution, renaming the tests/compile/test_blocks.js module so that goog.provide does not touch Blockly or Blockly.libraryBlocks, which may not exist / be writable. * feat(build): Add support named exports from chunks We need to convert the generators to named exports. For backwards compatibility we still want e.g. Blockly.JavaScript to point at the generator object when the chunk is loaded using a script tag. Modify chunkWrapper to honour a .reexportOnly property in the chunks table and generate suitable additional code in the UMD wrapper. * refactor(generators): Migrate JavaScript generator to named export - Export the JavaScript generator object as javascriptGenerator from the Blockly.JavaScript module(generators/javascript.js). - Modify the Blockly.JavaScript.all module (generators/javascript/all.js) to reexport the exports from Blockly.JavaScript. - Update chunk configuration so the generator object remains available as Blockly.JavaScript when loading javascript_compressed.js via a