-
Notifications
You must be signed in to change notification settings - Fork 625
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: update imports in examples for v11 #2363
fix: update imports in examples for v11 #2363
Conversation
Since #2362 covers three classes of issues, can you split it up into three issues? [Edit, that way we can close it, which is more visible in the github project] |
@@ -1,6 +1,6 @@ | |||
<script> | |||
import { onMount } from 'svelte'; | |||
import Blockly from 'blockly'; | |||
import * as Blockly from 'blockly'; |
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.
This should import each thing it needs individually as specified here. If you don't want to fix that now, feel free to file a bug to follow up.
Here and in Vue.
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 don't need the generators, but I do need to have core, library blocks, and english langfiles.
I updated the imports to
import * as Blockly from 'blockly/core';
import * as libraryBlocks from 'blockly/blocks';
import * as En from 'blockly/msg/en';
and added a call to Blockly.setLocale(En)
. This (and the inject
) call fail because Blockly
is undefined
.
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 applied the same change to the Vue example and it worked fine. Do you know what the difference is? @cpcallen to comment as well.
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.
The Vue demo is built using Vite. The Svelte demo is built using rollup. Gonna guess some of the packaging changes aren't compatible with our rollup config, but our config is also pretty out of date (e.g. we're using some commonjs plugin whose git repo was archived 3 years ago) so who knows where the problem lies. This probably warrants Christopher's eyes.
I would probably start by trying a new rollup config from scratch if they have an updated hello world example.
I'll also note that rollup says it is the bundler behind Vite, so the fact that it works over there seems promising. More likely to point to a problem in our specific rollup config than a deeper incompatibility
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.
Fixed by updating the version of rollup and some of their plugins. Refreshingly, everything that needed to be replaced or updated was clearly labeled.
@BeksOmega this is ready for re-review.
|
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.
Sweet! I don't know enough about any of these frameworks to approve in the truest sense. But sounds like you worked through a bunch of stuff. And this isn't load bearing code. So LGTM
The basics
The details
Resolves
Fixes #2364
Proposed Changes
For each plugin that has issues with imports when updated to v11:
Reason for Changes
Handle breaking change made in v11.
Test Coverage
Tested manually