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

Extension Requires Updated CODAL #4898

Closed
bsiever opened this issue Dec 27, 2022 · 11 comments
Closed

Extension Requires Updated CODAL #4898

bsiever opened this issue Dec 27, 2022 · 11 comments

Comments

@bsiever
Copy link

bsiever commented Dec 27, 2022

Describe the bug

An approved and listed extension, https://makecode.microbit.org/pkg/bsiever/microbit-pxt-rotate (https://github.com/bsiever/microbit-pxt-rotate), requires features that were introduced in CODAL 0.2.43 (see PR here).

Because MakeCode still relies on CODAL v0.2.40, compilation fails. The error message (due to not having a .hex) is "Cannot read properties of undefined (reading toString)".

On a related note, that error message doesn't really help the user pin down the source of the problem or give any idea how to get help.

To Reproduce

Simple:
Open https://makecode.microbit.org/_g1zRzj2qCU7u and try to download.

Detailed:

  1. Go to MakeCode: https://makecode.microbit.org/#editor
  2. Click on + Extensions
  3. Search for "rotate".
  4. Select the card/tile for microbit-pxt-rotate.
  5. Add in the block from the Rotate display palette.
  6. Try to compile and download.
  7. See error

Expected behavior

Successful compilation / download.

micro:bit version (please complete the following information):

All (1.5, 2.0, 2.21)

Desktop (please complete the following information):

All

@bsiever
Copy link
Author

bsiever commented Dec 29, 2022

By the way, this is mostly a question of "when will a CODAL update happen"? Is there any guidance on the the MakeCode for microbit release and update schedule?

@abchatra
Copy link
Collaborator

abchatra commented Jan 3, 2023

We release new CODAL for every yearly release (once a year). However, we do take hotfixes and opportunistically release if it is stable. @JohnVidler FYI

I will discuss with John in our next call and see if the bits are stable or not.

@abchatra
Copy link
Collaborator

abchatra commented Jan 3, 2023

@jaustin fyi

@bsiever
Copy link
Author

bsiever commented Jan 3, 2023

As mentioned, I've already got an approved extension that's using lancaster-university/codal-microbit-v2#227 . If CODAL isn't updated soon, the extension should be removed until it is.

I'm nearly done with an extension that uses another update: lancaster-university/codal-microbit-v2#177 .

Both updates seem lightweight and unlikely to impact other things. I'd sincerely appreciate if both could be included, but I understand if you're not able to test either/both sufficiently to do a hotfix.

The second one is for BLE access to logs: https://github.com/bsiever/microbit-pxt-blehid . I could probably do some hack to read directly from flash...but the public read in the PR would be a lot better.

Thanks!

@jaustin
Copy link
Collaborator

jaustin commented Jan 4, 2023

@bsiever I didn't realise the extension had been updated to use the newer CODAL.
I think realistically we won't push a new CODAL to live with these changes until the next MakeCode release.

However, I am very keen for /beta to start tracking latest CODAL ASAP

Can we either

  • use MakeCode's extension versioning so that the extension loads at an older version (before rotateTo is required in CODAL) and then have the latest version in /beta
  • mark the extension as 'beta' so there's a cue it will only work in the beta editor? (@abchatra is there any way yet to only have it show in /beta?)

@bsiever
Copy link
Author

bsiever commented Jan 5, 2023

@jaustin A /beta using more recent version of CODAL would be great for me. It would allow me to have a few additional people test things without the overhead of a local install. Keep me posted on whether that happens.

The rotate extension that does work in CODAL 0.2.40: https://github.com/bsiever/microbit-pxt-rotate/releases/v0.1.3 (written before Martin added the rotateTo() to CODAL).

Below was all redundant with jaustin's comment...
The v2 support relies on two hacks: replacing a member object in-place and a sketchy use of delete to overcome a memory leak (bad practice, but it think it's reliable in this context). One v2 it only rotates between things being displayed, like after an entire message has scrolled by, rather than entirely dynamically. On 1.5 it rotates as they are scrolling, which is also what the CODAL update will do in v2.

Off topic: Is there any way to add a specific version of an extension by URL? I took a quick look at docs and forums and didn't spot anything.

Now using the test versions in #4829 for some testing. Thanks!

@martinwork
Copy link
Contributor

@jaustin @bsiever @abchatra At the time of the PR #4866, the extension had a dependency on makecode.microbit.org 5.1.1.
I assumed MakeCode beta would bump CODAL to 0.2.43.

@martinwork
Copy link
Contributor

@bsiever Could you revert the change bsiever/microbit-pxt-rotate@58b6a85 to the MakeCode version dependency? Perhaps make it after the current beta (5.1.2)?

@bsiever
Copy link
Author

bsiever commented Jan 9, 2023

@martinwork Do you mean that if target in pxt.json is 5.1, the live version of the editor (5.0.12) will use the last extension version of the extension that referred to the MakeCode 5.0.12?

Would this need to be an official git revert or could it just be a new commit? (I'm assuming official revert and/or removal of the release?)

@martinwork
Copy link
Contributor

@bsiever That's a good question! I was just thinking to put back the dependency on a later MakeCode for the current version, hoping that would mean it's not visible in live anymore.

@bsiever
Copy link
Author

bsiever commented Jun 28, 2023

The recent update to production MakeCode, which now uses CODAL v0.2.55, has resolved this, so I'm closing the issue.

@bsiever bsiever closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants