Skip to content

Commit b69c38d

Browse files
gonfunkocpcallen
andauthored
feat: Reduce build size by enabling assume_function_wrapper build flag (#9921)
* chore: Format build_tasks.mjs * feat: Enable `assume_function_wrapper` build flag * refactor(build): Separate chunk exporter creation from compilation Since the chunk export files are source files to Closure Compiler, separate the creation of the former from the invocation of the latter. Specifically: - Rename writeChunkExportFiles to buildChunkExporters. - Invoked as a separate task in the minify series, instead of calling it directly from buildCompiled. - Revert the changes to buildCompiled that made it an async function just so it could call writeChunkExportFiles. * refactor(build): Use a separate property for each chunk's exports The existing code results in each chunk overwriting the same well-known property ($.__chunkExports__). Since these properties are only expected to be read once, in the same chunk's wrapper's factory function, this isn't strictly wrong - but it made understanding the minified bundles produced by PR #9912 a bit confusing. * cleanup(build): Minor naming improvements * docs(build): Improve JSDocs + inline comments Note that some comments have been deleted without replacement; these made statements which are no longer true. * cleanup(build): Reorder new chunk-exporters-related code Reorder the new code that generates the chunk exporters, to put it together with (but before) the code that generates the chunk wrappers, since the two are closely coupled. * fix(build): Rename chunk exporter's dir + filenames to "exporters" For consistency with code and docs, call the files that contain code which retrieves the chunks' export objects "chunk exporters", since "chunk exports" better describes the objects being exported. --------- Co-authored-by: Christopher Allen <cpcallen+git@google.com>
1 parent e22287e commit b69c38d

2 files changed

Lines changed: 264 additions & 111 deletions

File tree

packages/blockly/core/blockly.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ import {ZoomControls} from './zoom_controls.js';
234234
* This constant is overridden by the build script (npm run build) to the value
235235
* of the version in package.json. This is done by the Closure Compiler in the
236236
* buildCompressed gulp task.
237-
* For local builds, you can pass --define='Blockly.VERSION=X.Y.Z' to the
238-
* compiler to override this constant.
239237
*
240238
* @define {string}
241239
*/

0 commit comments

Comments
 (0)