I looked at the current implementation at https://produnto-test.toolforge.org/wiki/Module:Produnto_test and see it happening like this:
- require( 'databox' ), require( 'produnto_test' )
- mw.loadJsonData( 'produnto-test/src/test.json' )
I think calling any external data using this syntax is extremely bad for the following reasons:
- It breaks the established convention on how the module authors can know where the source of the pages is directly from their code. We do not write require( 'String' ) for standard modules (we use require( 'Module:String' )), we should not write require( 'produnto-test' ) for external modules.
- It creates potential confusion for module authors with existing shared modules like require( 'strict' ).
- It makes it impossible for extensions like SyntaxHighlight (and potentially MediaWiki-extensions-CodeMirror) to actually know where these modules are coming from and link to their sources for usability.
I think, before it’s too late, there should be some sort of prefix introduced for calling these external modules, like Package: from T425752: Produnto repository viewer: Package namespace.