What's the meaning of "ucidef_add_switch "switch0" "0u@eth0" "3:lan" "4:lan""

My router is gl-b1300, an ipq4028 device. I flashed the latest snapshot firmware, and the default network config is defined by

ucidef_set_interfaces_lan_wan "eth0" "eth1"
	ucidef_add_switch "switch0" \
		"0u@eth0" "3:lan" "4:lan"

It's different from the factory firmware(based on OpenWrt Chaos Calmer), which vlan settings were configured like below

config interface 'lan'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '0t 3 4'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option vid '2'
        option ports '0t 5'

If I apply the above config to the snapshot firmware and reboot, I would lost access into the router.
so what's the difference between these two vlan config methods?

In factory firmware, there are 3 ether ports and 1 cpu port in luci-network-switch, but in snapshot firmware, there are 2 lan ether ports and 1 cpu port, wan interface appears as eth1, not eth0.2.

So what's the relationship between eth0 or eth1 and switch ports?

You likely will lose settings, Chaos Calmer is old. Configs/etc. have been upgraded since then.

Compare your backups and setup your router manually.

I flash the firmware via u-boot, not via sysupgrade, and I do edit /etc/config/network manually.