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

Chris D

XenForo developer
Staff member
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.
 

suineg

Active member
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.
 

Sim

Well-known member
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).
 

MaGeFH

Active member
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.
 

Sim

Well-known member
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).
 
  • Like
Reactions: Xon

Brogan

XenForo moderator
Staff member
No.

The first public release will be available to anyone with an active license, not just developers.
 

Jaxel

Well-known member
I would assume that using class="fa fa-caret-right" uses the FA4 icon... while class="far fa-caret-right" is the FA5 icon?
 

Jaxel

Well-known member
Is the delete_confirm plugin only for admin sections? Or can it be used in public sections?
 

Imgbi

Member
Good job Dev.
I think it should be better to customize the Notification Icons.

The Notification is amazing!
 
Top