microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
710 stars 589 forks source link

offline app: built-in extensions should work offline (audio recording, for example) #5252

Closed eanders-ms closed 1 year ago

eanders-ms commented 1 year ago
  1. Run the offline app without internet connection.
  2. Make a simple program using the audio recording blocks.
  3. Click download.

Notice the compilation error message.

The audio recording/playback blocks are not usable without an internet connection.

Suggestion: precompile and include hex files for builtin extensions.

jwunderl commented 1 year ago

Ahh I think it's probably not checking for https://github.com/microsoft/pxt-microbit/blob/master/libs/audio-recording/pxt.json#L14 when building or something, that's the only thing I can think of as different vs datalogger; code is here https://github.com/microsoft/pxt/blob/master/cli/cli.ts#L2441, can point you to where it builds in offline app devops build.

I think the best fix is just not doing disablesvariant, that makes the user project completely unable to build for v1 anyways / it's basically just there as a fallback behavior? Though I suppose we do have the option of building for v2 only when you have a project that is too big for v1; I guess we should consider packing in v2 only hexes as well in general to handle that case?

jwunderl commented 1 year ago

Combination of https://github.com/microsoft/pxt-microbit/pull/5259 and https://github.com/microsoft/pxt/pull/9579 fixed this (5259 for removing disables variant, 9579 for packing in a matching hex file correctly)~