-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(tests): Fix & reenable the advanced compilation test #5781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rachel-fenichel
merged 2 commits into
RaspberryPiFoundation:develop
from
cpcallen:fix-advanced-compilation-test
Dec 3, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a case where there was already a Blockly global variable and we need to be able to refer to it by
Blockly.Msginstead of by importing it by name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the question, so I will say a few things in the hopes that one of them answers it:
core/,blocks/orgenerators/ever assumes the existence of aBlocklyglobal variable.goog.requirestatements in tests, etc., the only code in that should create aBlocklyglobal is this hack that tries to ensure thatgloablThis.Blockly.Msg(and only that) exists, and the call todeclareLegacyNamespaceat the top of this file that will create a globalBlocklyvariable when this file is loaded in uncompiled mode or (with help from the UMD wrapper) ifblockly_compressed.jsis imported with a<script>tag into the browser.importstatement or, if using Closure modules/compiler, agoog.require(e.g., Blockly Games and the advanced compilation test (ACT)).importworks outside of node, as I wasn't aware that browsers have a way of loading UMD modules in response to ESimportstatements, but I would generally expect that no globals would be created as a result unless the import was being done as a named import at the top (script) level, in which case the importer is probably going to name the importBlockly.Blockly) being renamed, so there a bunch of random 1- and 2-character variable names that are meaningless without a sourcemap.Blocklyglobal variable exists and points at the export object of this (blockly.js/Blockly) module, trying to load translations via<script>will fail. This means that the following excerpt fromtests/compile/index.html:en.jstried to doBlockly.Msg["ADD_COMMENT"] = "Add Comment"becauseBlockly.Msgwas undefined (until I fixed the issue in the first commit (8370647) of this PR).