Bundling Blockly with Parcel#682
Conversation
alschmiedt
left a comment
There was a problem hiding this comment.
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.
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); | ||
| }) |
| alert("Check the console for the generated output."); | ||
| const code = Blockly[lang].workspaceToCode(workspace); | ||
| console.log(code); | ||
| }) |
|
|
||
|
|
||
| document.addEventListener("DOMContentLoaded", function () { | ||
| const workspace = Blockly.inject('blocklyDiv', |
There was a problem hiding this comment.
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.
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. |
moniika
left a comment
There was a problem hiding this comment.
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.