We are required to make all our connections in a "junction box." The fixture canopy, or base, is considered as a "box" when installed.
As such, it is required to have enough space for the usual 6" of 'free conductors." (300.14)
What is not clear is whether there is required to be enough room for a second set of wires to exit, and continue on to the next fixture. It's not even clear if there is required to be room for the switch legs.
A classic example is the "pancake" box....it has room only for wires serving the device; there is no room for these other 'associated' wires.
Personally, I consider it no longer accepted practice to mount a fixture without using a box. Apart from wiring space, the box probides a much better mounting. But I wander....:-)