1

By now I know what the format of the generator is, the only question is I don't know where the 'goog' comes from.

Here is the partial code from my 'generator/arduino.js'

import * as Blockly from 'blockly/core'
// goog.provide('Blockly.Arduino')
// goog.require('Blockly.Generator')

/*
* Arduino generator
* @type {!Blockly.Generator}
* */
Blockly.Arduino = new Blockly.Generator('Arduino')

// ... the rest

I don't know where to import goog and I can't find 'closure/goog/base.js' in node_modules

When I try to manually add goog in package.json, there goes the error "import the same project repeatedly"

enter image description here

enter image description here

enter image description here

enter image description here

Harold HH
  • 33
  • 4
  • Maybe this? https://github.com/nbudin/react-blockly – Nathaniel Flick Mar 15 '21 at 03:03
  • @Nathaniel Flick This project shows a nice way to implement blockly in react, but still doesn't tell how to generate other programming languages. – Harold HH Mar 15 '21 at 05:43
  • Please see [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors-when-asking-a-question) – ggorlen Jun 29 '22 at 20:50

0 Answers0