Default, global oh-context

Is there any possibility, hack, idea how make some default oh-context for entire OH site ? So we could get some global functions, constants and variables that we can reuse in custom widgets. What do You think oof this?

I can’t really think of any way of achieving this with what’s currently available.

It might be worth an issue on the UI repository to start the discussion, but my guess would be it would get some pushback from the maintainers for two reasons. First, one of the primary concerns from the very beginning of OH3 has been to optimize the loading of pages and widgets by carefully limiting amount of data passed between the server and browser and the automatic injection of potentially unused variables etc. would go against that philosophy. Second, as part of their task to ensure the stability of a UI that already has a lot of places users can modify and add to it, the maintainers are, justifiably, cautious about any proposal that includes a possibility of system-wide breakage.

That said, I don’t think it’s a complete non-starter, and a good discussion about it may go somewhere interesting.

I made a custom widget, containing only oh-context. But when starting any new widget with this widget as parent of anything else, caused a lot of problems, the wired one was, all parameters were empty after widget:contextWidget, I could not figure way around this …

This doesn’t surprise me. As far as I know, it is not supported to have child components to a custom widget called by widget:WidgetName.

At the moment I can’t think of anyway to do what you’re trying to do.