Add menu items dynamically

Is there a way to add menu items to the plugin menu dynamically?

There exists MenuItems#insertAt( index: number, MenuItem ) (https://forums.adobeprerelease.com/photoshop/discussion/2034/update-uxp-release-4-1-2-214-pr41-m-1047).

But with the addition:
NOTE: this is misleading: it does not insert a new item, but overwrites the existing menu without properly removing it from the internal structure (meaning you can’t add the item back with the same id). You should avoid using this, as a future fix will change this behavior.

Are there any updates @kerrishotts?

That would be nice to have if XD supported flyout menus but I’d like to avoid those for edit context reasons. I’m thinking about adding new items to the Application > Plugins > My Plugin menu.

I’d like to add a few commands dynamically.

Right now the only way I can do that is to hard code the values in the manifest:

"uiEntryPoints": [
    {
        "type": "menu",
        "label": "My Plugin",
        "menuItems": [
            {
                "type": "menu",
                "label": {
                    "default": "Do something"
                },
                "commandId": "doSomething"
            },
            {
                "type": "menu",
                "label": {
                    "default": "Do something else"
                },
                "commandId": "somethingElse"
            },
            {
                "type": "menu",
                "label": {
                    "default": "Another menu"
                },
                "commandId": "anotherMenu"
            }
        ]
    }
]