1.4.9 • Published 3 years ago

@mobsya-association/node-blockly v1.4.9

Weekly downloads
2
License
ISC
Repository
github
Last release
3 years ago

Blockly for Node.js and Browser via CommonJS module

Build

Supports the AESL generator.

This fork adds AESL support for Thymio (and uses an older blockly version).

Install

npm i @mobsya-association/node-blockly

Usage

Browser

All generators

var Blockly = require('@mobsya-association/node-blockly/browser');

Internationalization

import Blockly from '@mobsya/node-blockly/browser';
import De from '@mobsya/node-blockly/lib/i18n/de';
Blockly.setLocale(De)

Dynamic imports also works but Blockly doesn't re-render workspace. You must re-render it manually after locale loaded

Generate the @mobsya-association/node-blockly npm package

In order to generate and publish the @mobsya-association/node-blockly , you will first need to build the compressed resources in the blockly submodule.

cd blockly
python build.py

After that this script has been succesfully executed, from the root directory you can launch

cd .. # if still under the blockly directory
npm publish

Workaround build-break 31/01/2020

Problem: In order to generate the ****_compressed.js files, build.py uses the online version of the closure compiler. Sometime in December 2019 some functions that are used by the blockly source have been removed from the closure libraries. The online compiler is always aligned with the latest version of this libraries, so trying to compile the thymio-blockly-standalone project generates an error ( caused by the removal of this libraries ).

Proper fix: The best fix would be to manually replace all the references to this functions from the blockly source code.

Workaround: The fix involves a lot of lines of code, temporarly we will just inject the old definition of this libraries inside blockly_compressed.js ( the one in the blockly submodule ). The code to inject is :

goog.isDef=function(a){return void 0!==a};goog.isString=function(a){return"string"==typeof a};goog.isBoolean=function(a){return"boolean"==typeof a};goog.isNumber=function(a){return"number"==typeof a};

This must be placed in:

var $jscomp=$jscomp||{};$jscomp.scope={};var COMPILED=!0,goog=goog||{};goog.global=this||self;
/* inject here */
goog.exportPath_=function(a,b,c) ....
1.4.9

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.2.1

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago