-
Notifications
You must be signed in to change notification settings - Fork 593
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
Convert pxtrunner into modules #9828
Conversation
Question: How will moving to modules impact shims? I know you said that we're not making everything to modules yet but would like to. If we change everything be a module, would we have to change how we connect logic between C++ and TypeScript? |
@srietkerk when i say switching to modules, i only mean for web code. "user code", like the stuff in the libs/ folder, won't be changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This PR looks much bigger than it actually is; you probably want to view the diff with ignore whitespace turned on.
Making this change because our new Blockly code is module based so everything that interacts with Blockly needs to be a module as well. There are no real changes to code here, just a straight conversion from namespaces to modules and fixing a bunch of qualified names.
I also defined a new file,
pxtrunner/embed.ts
, which puts all of the runner code into the global namespace so it can be appended to pxtembed.js (which is itself included in various pages like --docs, --embed, --run, etc.). The file serves as the entrypoint for browserifyEventually I'll get around to converting everything into modules and that file will no longer be necessary