import * as Blockly from 'blockly';
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/ac876560-4465-4f05-90b1-56156204dae2%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CALmzms73wHCPM98dSiSAxnfoJtx6_%2BCb2gyoyVfWNUU2mAebcA%40mail.gmail.com.
Creating your own custom blocks should be the same -- after importing Blockly, you just add your definition to Blockly.Blocks and Blockly.JavaScript (or Blockly.Python or whatever).Creating your own generator from the ground up instead of extending an existing one... Well, you can't really put it inside the "Blockly" namespace, but other than that it shouldn't be different, either.I'm not a fan of `import * as Blockly`, though. I would rather Blockly add a `default` export that is the Blockly object. `import *` is generally considered bad practice, and while `as Blockly` addresses the main reason not to do that (`import *` screws with static analysis so you can't tell what names are in scope at any given time, but assigning it to a name fixes that) it's still not the way it's usually done./s/ Adam
On Tue, Aug 13, 2019 at 12:37 PM Noah G <glase...@gmail.com> wrote:
Great work!!!Quick question how would you create your own custom blocks and generators. I know this is a lot to ask but could you create a demo of that?
On Tue, Aug 13, 2019 at 9:54 AM 'Sam El-Husseini' via Blockly <blo...@googlegroups.com> wrote:
Hey all,--We wanted to let you know that we are now officially publishing Blockly releases on NPM.Our npm package wraps each of our compressed files into a UMD module to allow you to do something like this in your web apps:
import * as Blockly from 'blockly';We have also built up a number of different samples to demonstrate how to integrate Blockly into your projects.Currently there are samples for React, Node, Webpack, Angular, Vue, UMD, and RequireJS. You can find the samples here:As always, we'd very much appreciate your feedback.Cheers,Sam
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/ac876560-4465-4f05-90b1-56156204dae2%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/ac876560-4465-4f05-90b1-56156204dae2%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CALmzms73wHCPM98dSiSAxnfoJtx6_%2BCb2gyoyVfWNUU2mAebcA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/cea22619-2f2e-4cba-b83f-a0e0fcafdf8f%40googlegroups.com.
I have quickly tested the react sample , It works perfectly on my local server but when I executed run build and deployed it to a shared hosting (savvystic.com) , it didnt work !
the console shows " Uncaught SyntaxError: Unexpected token < " twice !
I have changed nothing yet so I am not sure whats the issue ... thought ?
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/5e08ca41-ee10-4502-b231-ecb239033270%40googlegroups.com.