XF 2.1 When building add-ons, why does the release build include every data type?

Matt C.

Well-known member
When building my discord widget add-on, I noticed that in the _data folder, every data type is included. For example, it includes bb_codes.xml and the contents of that file are:

XML:
<?xml version="1.0" encoding="UTF-8"?>
<bb_codes/>

Is it necessary to include every single data type, even when they aren't in use? Thank you.
 
Let's say you release an add-on which had a bb_codes.xml file with 3 entries in it.

In the next version of your add-on, perhaps you remove those 3 entries, and the file was deleted.

Customer comes along and uploads the new files for the new version. Well, that bb_codes.xml file is deleted from the _data folder in your add-on, but that file would still exist on your customer's server from the previous version.

That means, unexpectedly, they would still have those 3 BB code entries that you intended to delete.

There might be other approaches in the future, but the best approach right now is to just export all of the files (even if they contain nothing) so that upgrades properly remove unused entries.
 
Back
Top Bottom