For some reason, the type checker doesn't catch this, but
FailToFinishReasonType.Unknown requires an error argument, otherwise
we get an unhandled exception.
Dispatch an error in case there is no firmware URL. Normally this should
never happen, but currently it does because we don't have EV3 firmware
yet. The error is more useful than just spinning forever.
Basic support for restoring the official EV3 firmware. Is missing a video
and needs a bunch of helpful error messages, but basic functionality
is working.
This is just the UI bits (new file template, Pybricks firmware install,
official firmware restore).
The Pybricks firmware flashing hangs because we don't have a EV3 firmware
yet in @pybricks/firmware. Official firmware restore has an alert()
placeholder so at least it does something.
Rename the requested program ID from slot to progId and the running
program ID to runningProgId. These can also have the value of built-in
programs, not just slot numbers, so it doesn't make sense to call them
slots.
I meant to change this before merging the previous commit, but missed it.
The mismatch test was hard to understand and didn't increase coverage,
so let's leave it out.
* Update for changed StartUserProgram command semantics
* Added new capability flags and fixed-purpose slot definitions
* Update for new start REPL command
* Updated StartUserProgram command and Status event for slots
* Added new AppData command and event
---------
Co-authored-by: David Lechner <david@pybricks.com>
Enable the stream option on the text decode for the stdout and uart
stream handlers that pipe data to the terminal. This fixes improperly
printing multibyte unicode characters that get split across multiple
data packets.
A new decode is added for each different stream in case both are used
at the same time.
Fixes: https://github.com/pybricks/support/issues/1743
Mac users have recently been reporting failed firmware updates due to
the hub disconnecting during the update process. This is likely due to
the Mac sending packets faster than the hub can handle. This changes
the arbitrary BLE firmware burst size from 10 to 8 to reduce the chance
of the hub getting overwhelmed.
Fixes: https://github.com/pybricks/support/issues/1787
For some reason, two is now using the last item in the svg group for
centering, which was one of the eyes. The changes the order so that the
body is not the last item and centering works again.
Dialogs were off of the screen due to the overlays being bigger than
the view port. This is fixed by adding some style to limit the size.
Also multi-step dialogs are hard-coded to have min-width of 800px in
blueprints.js, so we need to override this on smaller screens.
Fixes: https://github.com/pybricks/support/issues/1271
* build(deps): bump pyodide from 0.23.4 to 0.24.1
Bumps [pyodide](https://github.com/pyodide/pyodide) from 0.23.4 to 0.24.1.
- [Release notes](https://github.com/pyodide/pyodide/releases)
- [Commits](https://github.com/pyodide/pyodide/compare/0.23.4...0.24.1)
---
updated-dependencies:
- dependency-name: pyodide
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* updates for pyodide 0.24.0
- fix breaking file rename
- replace use of deprecated type
* use @pyodide/webpack-plugin
Pyodide 0.24 made some breaking changes that broke the way we were
integrating it with webpack manually. We can use the official webpack
plugin instead.
* webpack: add hack for pyodide
This works around "Critical dependency: the request of a dependency is an expression"
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Lechner <david@pybricks.com>
* build(deps): bump @types/react from 18.2.21 to 18.2.37
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.2.21 to 18.2.37.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)
---
updated-dependencies:
- dependency-name: "@types/react"
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* yarn: update react-splitter-layout
* fix type errors for react-splitter-layout
Upgrading to `@types/react` > 18.2.21 causes the following errors:
```
src/app/App.tsx:202:22 - error TS2786: 'SplitterLayout' cannot be used as a JSX component.
Its instance type 'SplitterLayout' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'import("/home/david/work/pybricks/pybricks-code/node_modules/@types/react-dom/node_modules/@types/react/ts5.0/index").ReactNode' is not assignable to type 'React.ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.
202 <SplitterLayout
~~~~~~~~~~~~~~
node_modules/@types/react/ts5.0/index.d.ts:175:9
175 children: ReactNode;
~~~~~~~~
'children' is declared here.
src/app/App.tsx:212:26 - error TS2786: 'SplitterLayout' cannot be used as a JSX component.
Its instance type 'SplitterLayout' is not a valid JSX element.
212 <SplitterLayout
~~~~~~~~~~~~~~
Found 2 errors in the same file, starting at: src/app/App.tsx:202
```
https://arethetypeswrong.github.io/?p=react-splitter-layout%404.0.0
provided the hint that we need `export =` instead of `export default`.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Lechner <david@pybricks.com>
On iOS `getAvailability()` returns false if the app does not have permission to use the bluetooth adapter (which is what the spec says it should do if permission has not been granted), so clarify the reason for it not being available.
Also add a sneaky reference to WebBLE as a supported browser on iOS.
This avoids trying to perform two DFU operations on the same device
at one time. Flashing is so fast, this seems the better option than
trying to support flashing more than one device at a time.
Fixes: https://github.com/pybricks/support/issues/1146
This was overlooked when we updated to React 18. This fixes console
error about using React 17 behavior.
StrictMode had to be disabled because it broke the editor.
Since updating to Blueprintjs 5.x we can get aliasing artifacts on the
cursor due to bad rendering of box-shadow. This overrides it with
border instead.
https://github.com/xtermjs/xterm.js/issues/4580
Since we share the same editor instance with multiple models, we need
to ensure undo stack consistency when changing the model, otherwise
we can lose some history, e.g. if a not active model is modified.
When we import/replace a file that is open in an editor, instead of
modifying the file in storage, we need to modify the file in the editor.
This allows the modification to be pushed on the undo stack so that
the user can undo the change in case it wrote over any of their recent
changes.
Issue: https://github.com/pybricks/support/issues/975
After updating to @types/node 18.x, we started getting an error when
mocking FileWithHandle. For some reason, the type hints don't allow
for partial implementation anymore.
Hack around the problem by just casting the partial implementation.