-
Notifications
You must be signed in to change notification settings - Fork 627
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
Bundling Blockly with Parcel #682
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.
Overall this looks great! There are a few nits on formatting, but once those are fixed this should be good to go.
Thanks for contributing!
import 'blockly/python'; | ||
|
||
import * as En from 'blockly/msg/en'; | ||
Blockly.setLocale(En); |
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.
nit: Add a line between imports and the first line of code.
examples/blockly-parcel/src/index.js
Outdated
alert("Check the console for the generated output."); | ||
const code = Blockly[lang].workspaceToCode(workspace); | ||
console.log(code); | ||
}) |
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.
nit: add ;
alert("Check the console for the generated output."); | ||
const code = Blockly[lang].workspaceToCode(workspace); | ||
console.log(code); | ||
}) |
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.
nit: add ;
|
||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
const workspace = Blockly.inject('blocklyDiv', |
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.
Should be an indent of 2 instead of 4.
examples/blockly-parcel/src/index.js
Outdated
/** | ||
* @license | ||
* | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. |
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 can now be replaced with:
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
@alschmiedt Thank you for reviewing. I applied your remarks to all the sources. |
😱 @alschmiedt I think I replaced spaces with tabs and now github renders it with 8 spaces instead of the original 4 while my vim renders it with 2. Let me try to fix that. Sorry about that. |
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.
Thanks for the PR! It looks like all comments were addressed.
I'm going to merge it in since Abby's currently OOO.
Addresses #681
Bundle Blockly in a Parcel project. Modeled on a similar example of bundling blockly with Webpack project.