-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: message loading from script tags #6060
Conversation
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.
@cpcallen fyi
So, my thoughts:
|
Thank you for the write up! I should have thought to test with |
The basics
npm run format
andnpm run lint
The details
Resolves
Possibly related to #4369. Fixes google/blockly-samples#1066 and fixes google/blockly-samples#1065
Proposed Changes
Removes redundant code from packaged msg files.
Behavior Before Change
If you load a message file from
dist/msg
in a script tag, or equivalently if you load a message file from the blockly node module via a script tag (such as we do in samples, or what you would do if you used unpkg) then the message references do not work and you get errors likeNo message string for %{BKY_TEXT_APPEND_TOOLTIP} in %{BKY_TEXT_APPEND_TOOLTIP}
and your blocks are broken.Behavior After Change
Message loading works correctly.
Reason for Changes
Rachel and I investigated this bug after realizing this issue has been present on some of the blockly-samples examples for a while. We are not 100% sure on the cause of this bug but we think this may be the cause based on some evidence:
Test Coverage
Tested various scenarios. These worked before and continue to work:
npm run start
)These were broken before this change but now work:
I would like to test with angular or react to see if #4369 is resolved but still working on that.
Documentation
Additional Information
Our current plan is to release a beta version with this change, and ask some folks that seemed affected by this issue to test with the beta. If it works, and if Christopher agrees, then we can release a patch version of Blockly with this change.
We can also use the beta to update the blockly-samples gh-pages site since that is currently blocked by this issue.
We want to wait for Christopher's opinion as the resident expert on module loading.