2sxc v20 is a major release. It will drop baggage from 13 years of history, but has breaking changes.
TL;DR
2sxc v20 is dropping old habbits to prepare for the future. This means many breaking changes.
Key takeaways
- Almost all of the changes will only affect you, if you work on DNN and have code which is ancient - 5 to 10 years old.
- Oqtane is probably not affected, and newer code is not affected either.
- But we often see people copy-paste old code into new solutions, so there even newer work may be affected.
- If your code breaks, 2sxc will usually show you how to fix it.
As you update to v20, make sure you are well informed. Plan in some extra time for repairs, and avoid doing upgrades on live sites.
Time to Break with Tradition
2sxc was created in 2012 and has a lot of history. Most of it is not felt by the users, but this history creates internal complexity. Internal complexity means new features are harder to implement and releases are often tested for old features which may not be in use any more.
An extreme example: The list of items in 2sxc v2 used a concept of the "Element" which we dropped in future versions, but Razor code from these old days still work. Maintaining this compatibility comes at a high cost, even though we don't think anybody is using this. There are numerous examples like this.
In previous versions, we started adding warnings when old APIs were used, in the hopes that people would gradually update their code.
But we're pretty sure that people just got used to the warnings and ignored them 😟.
But the future has high demands on code quality. Proper code needs things such as
- SoC = separation of concerns
- a SOLID architecture
- dependency injection
- functional programming without side-effects
- nullability checks at compile time
- unit tests
- ...and way more
We have been continously rewriting the internal 2sxc code for these paradigms, but often old features have prevented us from doing it all the way. Old "static" Render() methods had to continue to work without dependency injection 😲. Old "CustomizeData()" APIs prevented us from making data sources functional, since they used side-effects.
So it's finally time to break with tradition, and live in the future. This means breaking changes.
We are calling this an MoT-Release (Moment of Truth), since this is where the rubber hits the road, and some hard truths become apparent. It's our first ever release of this kind, and we don't expect another one for many years to come.
Highlights
We want to emphasize that the breaking change are great. With these changes, 2sxc will become much easier to understand, naming becomes more clear, internal/external APIs will be easier to differentiate and much more. The following "highlights" are most likely to affect you:
- All the SQL tables were renamed and improved (performance 👍🏼). This should only affect you, if you had tried to access the database directly.
- All DLLs were reorganized, so that they are more dedicated to a specific purpose and easier to test/improve for others who wish to contribute.
- In DNN, the folder is changed to /DesktopModules/ToSic.Sxc - so no more "SexyContent" there. This may affect you if you had direct links to the 2sxc.min.js or if you were still using the old Thumbnailer.aspx, which doesn't exist any more in the old location.
- In DNN, older Razor files automatically triggered loading of jQuery. This will not happen any more, so in rare cases some JS may break, until you manually specify that jQuery should be loaded.
- Some old APIs such as CustomizeData and CustomizeSearch were removed. This will only affect you if you had very old code and/or used an old way to fill the DNN search index.
Note that the list of breaking changes is very long, so we won't repeat it in this blog. Check out the docs for breaking changes in 2sxc v20.
Softening the Blow
This will cause discomfort for many of you. But rest assured that we (2sic, the makers of 2sxc) will suffer the most, since we have more "old" solutions than anybody else.
We deeply care for the work we do and our developers. So we also spent a lot of time to capture common errors caused by this change, and guide developers to the solution.
Here's an example: if your code used CustomizeData(), the compiler will throw an error and 2sxc will detect it - and then show you something like this:

In the error, you would see why you get this error with a suggestion to read https://go.2sxc.org/brc-20-customizedata which will explain what the old code would have done, and how you should go about fixing it.
💡 If you run into problems which don't have guidance, please report it so we can add detections for that specific problem and provide help.
Do Backups and Test Upgrades
We have tested 2sxc and believe that it is just as good as the previous v19 LTS releases, except that you must but always test before you upgrade on a live system.
As mentioned before: for any Apps created with newer conventions since ca. 2020, we don't expect any problems - unless you copy-pasted old stuff from random sources.
➡️ Get the latest release from GitHub.
With ❤️🩹 from Switzerland,
iJungleboy


