I’ve been trying to catch up on the recent development changes as we’re getting closer to MODX3 release, and I noticed the documentation seems to be incorrect or not updated for building an Extra. For instance, it displays the same build scripts and articles for the 3.x branch and the Doodles tutorial. That tutorial does not work under 3x.
Some questions I have:
- Are build scripts backward compatible?
- In testing the Doodles tutorial, the “parseSchema” function seems to result in the new file structure and namespace usage. But that is then not compatible with “addPackage” it seems.
- I found that I can install my Extra in 3.0 and it works great, until it comes to the build process. So the manager page, connectors and processors are all compatible.
- I understand this is a Breaking Change, but just looking for clarity around Extra contributors and maintainers. The communications give the impression that you might be good to go until 3.2 or 3.3 when deprecated classes are fully removed. In my testing, it looks like that could be true if you kept a 2.x instance of MODX to do your Extra development on and run your build. Then install it to 3.x and test it, then publish it.
- Clear documentation on what should be backward compatible will allow reporting of bugs rather than reporting things that are not planned to be backward compatible.
- Are Docs updates and enhancements going to happen post launch?
- I’m sure this is an “it depends” type of answer based on community involvement, etc.
- If I can get some clarity around a vanilla simple MDX3 extra I can take on writing an updated tutorial for MODX3 docs. It might be time to retire “Doodles” and replace it with something else? Or just expand on that concept.
- Anyone have some clarity on the Autoload vs. the system property (extension_packages) that was used to include an Extra at instantiation?
- Does the “bootstrap.php” file replace the need to add the “extension_packages” system property?
- What would be the format to add a package and service from within a Snippet now? So if I only wanted my Extra to load when needed in the Snippet. From an efficiency perspective, we wouldn’t want it to load at instantiation.
- In my case I’d like to rewrite my extra to follow MODX3 and that version would require 3.0 minimum. Any suggestions on Github process, like forking vs. branching.
- I noticed that things like Tagger have a 3.x branch. But I would think that means when 3 goes live, it would be merged in. The assumption there would be that no further fixes would be supported on 2.x?
- If you forked the repo and made all the 3.x changes there, would that cause confusion anywhere?
I know I’ve asked a ton of questions here… sorry! Pick your favorite and answer whatever you want
References:
https://docs.modx.com/3.x/en/extending-modx/tutorials/developing-an-extra
This one is 4 years old, but was helpful and works under 3.0.0-beta2. It was a little unclear on how to execute the snippets. I just added in a line to include the index from the site root so I had access to $modx then ran them from the command line.
And maybe most people already understand PHP namespaces and PSR-4, but I found this introduction understandable, and useful as an intro: