Skip to content
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

Merged
merged 6 commits into from
May 7, 2021
Merged

Bundling Blockly with Parcel #682

merged 6 commits into from
May 7, 2021

Conversation

2torus
Copy link
Contributor

@2torus 2torus commented Apr 29, 2021

Addresses #681
Bundle Blockly in a Parcel project. Modeled on a similar example of bundling blockly with Webpack project.

@alschmiedt alschmiedt self-requested a review April 30, 2021 00:11
Copy link
Contributor

@alschmiedt alschmiedt left a 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);
Copy link
Contributor

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.

alert("Check the console for the generated output.");
const code = Blockly[lang].workspaceToCode(workspace);
console.log(code);
})
Copy link
Contributor

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);
})
Copy link
Contributor

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',
Copy link
Contributor

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.

Comment on lines 1 to 16
/**
* @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.
Copy link
Contributor

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
 */

@2torus
Copy link
Contributor Author

2torus commented May 7, 2021

@alschmiedt Thank you for reviewing. I applied your remarks to all the sources.

@2torus
Copy link
Contributor Author

2torus commented May 7, 2021

😱 @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.

Copy link
Contributor

@moniika moniika left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants