Skip to content
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

Merged
merged 4 commits into from
Jan 24, 2024
Merged

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Jan 22, 2024

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 browserify

Eventually I'll get around to converting everything into modules and that file will no longer be necessary

@riknoll riknoll requested a review from a team January 22, 2024 19:32
let theme = pxt.appTarget.appTheme;
let body = $('body');
let $footer = $(footer)
let footera = $('<a/>').attr('href', theme.homeUrl)

Check warning

Code scanning / CodeQL

Potentially unsafe external link Medium

External links without noopener/noreferrer are a potential security risk.
@srietkerk
Copy link
Contributor

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?

@riknoll
Copy link
Member Author

riknoll commented Jan 23, 2024

@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

Copy link
Collaborator

@eanders-ms eanders-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@riknoll riknoll merged commit 8bea667 into master Jan 24, 2024
6 checks passed
@riknoll riknoll deleted the dev/riknoll/runner-modularization branch January 24, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants