-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Node.js Tracking bug #2082
Comments
Are you testing these with the Node package created via |
I'm not testing this or owning this effort. Rachel made me file something here so that I could annotate the TODOs in Blockly.Xml.utils that point out the code there fails due to the use of global objects not present in Node (such as document). :) |
Is there any work being done to make the blockly to be imported into Node.js environment? Our usecase is to use blockly in NodeJS and generate the code from blockly XML file. |
@rachel-fenichel, is there an update on this issue? We would love to use Blockly within the adaptive learning environments we are creating in Unity, getting this to work would be a huge help to us. Thanks. :-) |
I would also like to ask for an update on this, for the reason that we've actually been using Blockly on Nodejs for some time by doing overrides of the blockToDom and domToVariables to use childNodes instead of children and commenting out |
@amber-cd We don't have anyone actively working on it right now. Our eng team is focusing on rendering and keyboard navigation. I would be open to a PR that gets this working for headless mode (your use case), even if it doesn't fix everything. I know that our gulpfile has a snippet of code to use JSDOM instead of DOMParser in Blockly.Xml.utils.textToDomDocument; I think we need to do something similar for the other functions mentioned above. The other problem I'm aware of is that we have a lot of references to |
For those that need a solution sooner, check out this repository: https://github.com/mo4islona/node-blockly |
Hey @DaveWelling. We have also since tackled this issue. You can read more about the release here: https://groups.google.com/forum/#!topic/blockly/HZuw6KZWqYY We are officially publishing our releases to NPM, wrapping each of our compressed files in a UMD module. We chose UMD to support both AMD and CommonJS ecosystems. This should work out the box for Node, you can find it on NPM here: and there's a sample for using it with Node here: |
@samelhusseini can this bug be closed or is there more work to do? |
Yes, we still need an XML serializer polyfill for |
I think this can be closed now. |
Meta bug for tracking issues with running Blockly under Node.js.
Known issues:
Blockly.utils.xml.createElement
&Blockly.utils.xml.createTextNode
Blockly.utils.xml.domToText
Blockly.utils.xml.textToDomDocument
The initial goal is to be able to load a set of blocks from XML onto a headless workspace, and generate code.
The text was updated successfully, but these errors were encountered: