Topic on VisualEditor/Feedback

Migrating extension to new version

1
Ti infotrad (talkcontribs)

I guess I should have posted here (duplicate of Topic:X7cpvcy75tfx0s7d)

I presently have a couple of extensions which are integrated with VisualEditor in MW 1.35. I am trying to migrate them to the new version (MW 1.39 RC1, downloaded zip) but I am getting a number of errors: non existing functions (template spec extend, onRawFallbackButtonClick, getParameterNames..). I have not been able to find documentation explaining how to migrate. Is there any available? Any help you can provide? I also could not find a list of extensions integrated in VE, which I could use to perform code comparisons.


And to be ultra precise, here is the error I am getting. Note I have not changed the code and it was working fine in my previous version of MW.

In my extension module, I have implemented the function insertTransclusionNode. In it, when inserting a new node, once I have build my object (getPlainObject), I call the following function

surfaceFragment.insertContent( [{type: 'gacdmslinker',attributes: {mw: obj,calaction: 'insert'}},{ type: '/gacdmslinker' }] );

and this is when I get the following error:

VM522:28 Uncaught TypeError: Converting circular structure to JSON

    --> starting at object with constructor 'VeDmDocument'

    |     property 'bindings' -> object with constructor 'Object'

    |     property 'transact' -> object with constructor 'Array'

    |     ...

    |     property 'context' -> object with constructor 'VeDmInternalList'

    --- property 'document' closes the circle

    at JSON.stringify (<anonymous>)

    at ve.dm.Surface.storeChanges (load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector&version=1lvvz:180:941)

    at OO.EventEmitter.emit (<anonymous>:28:656)

    at ve.dm.Surface.breakpoint (load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector&version=1lvvz:175:902)

The weird thing is, my object (gacdmslinkernode) is still created in the sense that, if I save the document and re-edit it with VE, it shows up correcly. However, the error seems to be preventing the insertion of the title of the object (but not of the associated icon) and instead it uses the page title as the title. And also, when I update an existing node, I get no error and it works fine.

Reply to "Migrating extension to new version"