Skip to content

Conversation

@microbit-matt-hillsdon
Copy link
Collaborator

@microbit-matt-hillsdon microbit-matt-hillsdon commented Mar 3, 2021

This is a first step PR that aims to get it in a working state.

I've aligned semantics of connect / disconnect with the v2 editor (though I'd like to change them).

The key missing thing is the event reporting via document custom events. The code is similar enough to go through in one pass and reinstate them. I've kept all of the console logging for ease of comparison with the v2 editor, though we'll want to abstract it a bit when we want to get to the point of a reusable library.

Some other minor tweaks based on alignment with v2 also included.

The error-handling UI is pretty much untested, my assumption is that we'll replace it with something bespoke for WebUSB.

Substantially the same as in v2.

Needs significant refactoring and conversion to TypeScript, but I think
it's in a working state and ought to have all the same bugs :)

I've somewhat gutted my top-level connection class as it'll be easier to
reimplement serial and connection states on top of this.
I think this is enough to merge with some testing, though the code still
needs a lot of work.
export const log = console.log;

// How was this defined before? Bug?
export const timeoutMessage = "timeout";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this might be the source of the "undefined" case in the error handler, as it was just missing in v2 PartialFlashingUtils. Leaving for a second pass through this though.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit e488796 into main Mar 3, 2021
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the partial-flashing branch March 3, 2021 11:20
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.

2 participants