Scripted module version vs Slicer version

I have an extension that contains a scripted module (SlicerPRISMRendering) that I need to modify to work with the new markup system in Slicer 4.13. The modification will break the compatibility with the current stable version of Slicer (4.11). How can I support both versions?

Here’s what I deducted I should do (please confirm, I cannot find documentation on that):

  • Create a slicer-4.11 branch in my extension repository
  • In the ExtensionsIndex repository, on the 4.11 branch, modify slicerPRISMRendering.s4ext to point to my extension’s slicer-4.11 branch
  • Modify the master branch of my extension to work with Slicer 4.13 (assuming that slicerPRISMRendering.s4ext in the master branch of the ExtensionsIndex is still pointing to the master branch of my extension’s repository)

Yes all that seems to match the content below:

https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#extensions-index

Extension developers have to make sure that the extension description in each branch of the Extensions index is compatible with the corresponding Slicer version. Extension developers often create the same branches ( master , 4.11 , 4.13 , …) in their repository and they specify this branch name in the extensions descriptor file.

1 Like

I would just add that if there are only a few minor differences then you can manage them by checking the Slicer or VTK version. For example:

If there are too many such checks or you need to do things completely differently in different Slicer versions (or you simply don’t want to carry the baggage of backward-compatibility any further) then you can create the branches as described above - cutting off older versions from “automatic” updates from the latest versions.