XF 2.1 What's new for developers in XF 2.1?

It's ok, developers, breathe a sigh of relief... We do have some good things for you in XF 2.1 but at a slightly smaller scale than the changes we introduced in XF 2.0 šŸ˜‰

Welcome to the seventh (admittedly developer oriented) "Have you seen...?" thread for XF 2.1. As ever, if you've not yet seen the previous entries, (why not?!) you can check them out here.

To ensure you're kept up to date, we strongly recommend giving that "Watch forum" link a scare and make sure you enable email notifications if you haven't done so already šŸŽƒ
 
I never worked with composer before. Do we need to install it? And could you provide some example code how to work with it?
It's only needed if you're developing an add-on and you want to include a third party dependency. Even then it's not strictly required, but as a developer tool it makes a lot of sense to use it.

Support with composer is really beyond the scope of this thread and support in general. I would recommend starting with any official documention first: https://getcomposer.org/doc/01-basic-usage.md

Then if you have any specific questions about it, probably post a new thread in the XenForo development discussions forum.
 
If you currently have an add-on which implements a "Like" content handler you may be wondering how you migrate to "Reactions" in XF 2.1 and what will happen to your existing likes.
I am thrilled by this. A lot of the reactions addons don't handle alerts very well because it's a hard spot not tied into Likes but it's own entity. So many of my users are annoyed that they can't turn off alerts for reactions.
 
What about tests does xenforo include now tests for the core and plugin development.

There would be no reason for the XF team to ship tests for the core - they can do that internally and then strip it out when shipping. You ideally don't want to ship tests in production - and we have no need to run tests they have already run themselves.

Tests for plugin development are very much non-trivial since it depends on exactly what it is you are developing. Front-end UI changes require a very different approach to back-end code tests. Once you start using code hooks, template replacements and so on - it becomes quite complicated from a testing perspective.

The class extension mechanism within XF makes it tricky to test things too.

What is it you are wanting to test anyway?

(FWIW, I write unit tests for my stand-alone classes which are not extensions of existing XF classes that were created using the extend method).
 
There would be no reason for the XF team to ship tests for the core - they can do that internally and then strip it out when shipping. You ideally don't want to ship tests in production - and we have no need to run tests they have already run themselves.

That's not correct. If you develop an addon you could use the default tests (with hooks enabled) to test if your code has any negative impact on standard forum behavior that you might have missed. This happens a lot. ;)

The class extension mechanism within XF makes it tricky to test things too.

Really? I can't imagine any scenario that would be problematic.
 
That's not correct. If you develop an addon you could use the default tests (with hooks enabled) to test if your code has any negative impact on standard forum behavior that you might have missed. This happens a lot. ;)

By definition, an addon changes the "standard forum behaviour" ... so what exactly are you proposing that the supplied tests actually test for?

Really? I can't imagine any scenario that would be problematic.

For unit testing, you really want to avoid loading the entire framework - which means that the class extension facilities will not be available.

Of course, if you want to do some kind of integration testing, that's a different exercise - I was specifically referring to unit tests.

Integration tests are not trivial to execute, since they require a fully functional forum instance - including database populated with actual data, in order to perform. You would pretty much need to have a separate installation or some kind of auto-building system to be able to run repeatable integration tests (any changes made to the database as a result of test execution need to be rolled back to make the test repeatable).
 
No.

The first public release will be available to anyone with an active license, not just developers.
 
I would assume that using class="fa fa-caret-right" uses the FA4 icon... while class="far fa-caret-right" is the FA5 icon?
 
Top Bottom