mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
refactor(build): Stop flattening Blockly sources during compilation in preparation for move to ES modules (#5918)
* refactor: Stop flattening Blockly sources during compilation in preparation for move to ES modules * fix: Remove obsolete accessControls and add comment about visibility changes
This commit is contained in:
@@ -173,7 +173,6 @@ function stripApacheLicense() {
|
||||
* https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/DiagnosticGroups.java#L113
|
||||
*/
|
||||
var JSCOMP_ERROR = [
|
||||
'accessControls',
|
||||
'checkPrototypalTypes',
|
||||
'checkRegExp',
|
||||
'checkTypes',
|
||||
@@ -216,7 +215,19 @@ var JSCOMP_ERROR = [
|
||||
'unusedPrivateMembers',
|
||||
'uselessCode',
|
||||
'untranspilableFeatures',
|
||||
'visibility'
|
||||
/* In order to transition to ES modules, modules will need to import one
|
||||
* another by relative paths. This means that the existing practice of moving
|
||||
* all source files into the same directory for compilation (see docs for
|
||||
* flattenCorePaths) would break imports. Not flattening files in this way
|
||||
* breaks our usage of @package however; files were flattened so that all
|
||||
* Blockly source files are in the same directory and can use @package to mark
|
||||
* methods that are only allowed for use by Blockly, while still allowing
|
||||
* access between e.g. core/events/* and core/utils/*. For now, we're
|
||||
* downgrading access control violations (including @private) to warnings.
|
||||
* Once ES module migration is complete, they will be re-enabled and an
|
||||
* alternative to @package will be established.
|
||||
*/
|
||||
// 'visibility'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -537,10 +548,10 @@ function buildCompiled() {
|
||||
return gulp.src(chunkOptions.js, {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
.pipe(gulp.rename(flattenCorePaths))
|
||||
// .pipe(gulp.rename(flattenCorePaths))
|
||||
.pipe(compile(options))
|
||||
.pipe(gulp.rename({suffix: COMPILED_SUFFIX}))
|
||||
.pipe(gulp.sourcemaps.mapSources(unflattenCorePaths))
|
||||
// .pipe(gulp.sourcemaps.mapSources(unflattenCorePaths))
|
||||
.pipe(
|
||||
gulp.sourcemaps.write('.', {includeContent: false, sourceRoot: './'}))
|
||||
.pipe(gulp.dest(BUILD_DIR));
|
||||
@@ -568,13 +579,14 @@ function buildAdvancedCompilationTest() {
|
||||
compilation_level: 'ADVANCED_OPTIMIZATIONS',
|
||||
entry_point: './tests/compile/main.js',
|
||||
js_output_file: 'main_compressed.js',
|
||||
jscomp_warning: ['visibility'],
|
||||
};
|
||||
return gulp.src(srcs, {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
.pipe(gulp.sourcemaps.init())
|
||||
.pipe(gulp.rename(flattenCorePaths))
|
||||
// .pipe(gulp.rename(flattenCorePaths))
|
||||
.pipe(compile(options))
|
||||
.pipe(gulp.sourcemaps.mapSources(unflattenCorePaths))
|
||||
// .pipe(gulp.sourcemaps.mapSources(unflattenCorePaths))
|
||||
.pipe(gulp.sourcemaps.write(
|
||||
'.', {includeContent: false, sourceRoot: '../../'}))
|
||||
.pipe(gulp.dest('./tests/compile/'));
|
||||
|
||||
@@ -64,23 +64,18 @@
|
||||
"./core/utils/useragent.js",
|
||||
"./core/utils/svg.js",
|
||||
"./core/utils/dom.js",
|
||||
"./core/utils/idgenerator.js",
|
||||
"./core/connection_checker.js",
|
||||
"./core/toolbox/separator.js",
|
||||
"./core/toolbox/toolbox_item.js",
|
||||
"./core/interfaces/i_selectable_toolbox_item.js",
|
||||
"./core/interfaces/i_collapsible_toolbox_item.js",
|
||||
"./core/toolbox/category.js",
|
||||
"./core/serialization/exceptions.js",
|
||||
"./core/interfaces/i_serializer.js",
|
||||
"./core/serialization/registry.js",
|
||||
"./core/serialization/priorities.js",
|
||||
"./core/serialization/blocks.js",
|
||||
"./core/utils/toolbox.js",
|
||||
"./core/keyboard_nav/ast_node.js",
|
||||
"./core/keyboard_nav/cursor.js",
|
||||
"./core/registry.js",
|
||||
"./core/utils/math.js",
|
||||
"./core/utils/idgenerator.js",
|
||||
"./core/utils/array.js",
|
||||
"./core/workspace.js",
|
||||
"./core/utils/object.js",
|
||||
"./core/events/events_block_delete.js",
|
||||
"./core/toolbox/separator.js",
|
||||
"./core/toolbox/toolbox_item.js",
|
||||
"./core/keyboard_nav/basic_cursor.js",
|
||||
"./core/keyboard_nav/tab_navigate_cursor.js",
|
||||
"./core/warning.js",
|
||||
@@ -121,7 +116,6 @@
|
||||
"./core/options.js",
|
||||
"./core/interfaces/i_bounded_element.js",
|
||||
"./core/grid.js",
|
||||
"./core/css.js",
|
||||
"./core/flyout_button.js",
|
||||
"./core/contextmenu_registry.js",
|
||||
"./core/theme/classic.js",
|
||||
@@ -134,7 +128,6 @@
|
||||
"./core/renderers/zelos/path_object.js",
|
||||
"./core/renderers/zelos/drawer.js",
|
||||
"./core/renderers/zelos/renderer.js",
|
||||
"./core/utils/aria.js",
|
||||
"./core/field_textinput.js",
|
||||
"./core/field_image.js",
|
||||
"./core/renderers/zelos/constants.js",
|
||||
@@ -162,11 +155,8 @@
|
||||
"./core/renderers/measurables/input_row.js",
|
||||
"./core/renderers/measurables/inline_input.js",
|
||||
"./core/scrollbar.js",
|
||||
"./core/interfaces/i_toolbox_item.js",
|
||||
"./core/interfaces/i_toolbox.js",
|
||||
"./core/utils/metrics.js",
|
||||
"./core/interfaces/i_metrics_manager.js",
|
||||
"./core/interfaces/i_flyout.js",
|
||||
"./core/metrics_manager.js",
|
||||
"./core/interfaces/i_deletable.js",
|
||||
"./core/interfaces/i_draggable.js",
|
||||
@@ -196,15 +186,14 @@
|
||||
"./core/events/events_var_delete.js",
|
||||
"./core/variable_map.js",
|
||||
"./core/names.js",
|
||||
"./core/events/events_block_base.js",
|
||||
"./core/events/events_block_change.js",
|
||||
"./core/events/events_ui_base.js",
|
||||
"./core/events/events_marker_move.js",
|
||||
"./core/renderers/common/marker_svg.js",
|
||||
"./core/keyboard_nav/marker.js",
|
||||
"./core/keyboard_nav/ast_node.js",
|
||||
"./core/keyboard_nav/cursor.js",
|
||||
"./core/marker_manager.js",
|
||||
"./core/field_label.js",
|
||||
"./core/input_types.js",
|
||||
"./core/interfaces/i_registrable_field.js",
|
||||
"./core/field_registry.js",
|
||||
"./core/input.js",
|
||||
@@ -227,10 +216,8 @@
|
||||
"./core/procedures.js",
|
||||
"./core/workspace_svg.js",
|
||||
"./core/utils/rect.js",
|
||||
"./core/utils/size.js",
|
||||
"./core/utils/coordinate.js",
|
||||
"./core/utils/style.js",
|
||||
"./core/utils/deprecation.js",
|
||||
"./core/utils/svg_math.js",
|
||||
"./core/bubble_dragger.js",
|
||||
"./core/block_animations.js",
|
||||
@@ -239,9 +226,23 @@
|
||||
"./core/browser_events.js",
|
||||
"./core/tooltip.js",
|
||||
"./core/block_svg.js",
|
||||
"./core/events/events_block_base.js",
|
||||
"./core/events/events_block_change.js",
|
||||
"./core/utils/xml.js",
|
||||
"./core/interfaces/i_flyout.js",
|
||||
"./core/interfaces/i_toolbox.js",
|
||||
"./core/interfaces/i_toolbox_item.js",
|
||||
"./core/interfaces/i_selectable_toolbox_item.js",
|
||||
"./core/interfaces/i_collapsible_toolbox_item.js",
|
||||
"./core/utils/aria.js",
|
||||
"./core/utils/deprecation.js",
|
||||
"./core/css.js",
|
||||
"./core/toolbox/category.js",
|
||||
"./core/input_types.js",
|
||||
"./core/utils/size.js",
|
||||
"./core/serialization/exceptions.js",
|
||||
"./core/interfaces/i_serializer.js",
|
||||
"./core/serialization/registry.js",
|
||||
"./core/serialization/priorities.js",
|
||||
"./core/serialization/blocks.js",
|
||||
"./core/utils/toolbox.js",
|
||||
"./core/connection_type.js",
|
||||
"./core/internal_constants.js",
|
||||
"./core/mutator.js",
|
||||
@@ -251,14 +252,13 @@
|
||||
"./core/extensions.js",
|
||||
"./core/block.js",
|
||||
"./core/utils/string.js",
|
||||
"./core/utils/object.js",
|
||||
"./core/dialog.js",
|
||||
"./core/utils/xml.js",
|
||||
"./core/events/events_var_base.js",
|
||||
"./core/events/events_var_create.js",
|
||||
"./core/variable_model.js",
|
||||
"./core/variables.js",
|
||||
"./core/events/events_abstract.js",
|
||||
"./core/registry.js",
|
||||
"./core/events/utils.js",
|
||||
"./core/xml.js",
|
||||
"./core/connection.js",
|
||||
|
||||
Reference in New Issue
Block a user