How is the tag defined and handled and when we want to use this tag? I prefer https://mage2.pro/t/topic/1186 but can't get actual idea.
4 Answers
<sequence>
declares the list of components that must be loaded before the current component is loaded. It’s used for loading a different kind of files: configuration files
, view files
(including CSS, LESS, and template files), or setup classes
.
Note that <sequence>
does not affect the loading of regular classes (non-setup classes). Setup classes are classes in the component that create or update database schema or data.
Source : Magento DevDocs
You can read more from Magento DevDocs
Sequence tag its not dependency. All dependencies we show only in composer.json each module.
In module.xml, we specify a sequence, i.e. sequence (when one module should be installed after another)
For example, we want to change the configuration of the current module or create a foreign key in the db, so our module should be installed after the modificated module, and actually this we specify it in a sequence.
Sequence tag is getting used to show depenency of module.This tag is used in module.xml file.
Below is the example for it.
Please refer below url for more detail
http://devdocs.magento.com/guides/v2.0/extension-dev-guide/build/module-load-order.html
-
As i understand <sequence> means our first module load before vendor module like that? @Arpita shah Commented Jan 10, 2018 at 13:52
-
It is actuall Component load order You may need to specify your component’s dependency on other components or files from other components using your component’s composer.json. Further, you can specify a load order in your component’s module.xml file using the tag to ensure that needed files from other components are already loaded when your component loads.
It’s used for loading different kind of files: configuration files, view files (including CSS, LESS, and template files), or setup classes.
Examples
Assume you have a component that needs a configuration file from another component:
Component A introduces gadgetlayout.xml, which updates block gadgetBlock from component B. In this case, layout files from component A should be loaded before component B, so you should specify that in component B’s entry in module .xml. In other words, component B is dependent on component A. That is to say:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_ComponentB" setup_version="0.0.1">
<sequence>
<!-- Vendor_ComponentB is dependent on Vendor_ComponentA: -->
<module name="Vendor_ComponentA" />
</sequence>
</module>
</config>
Thanks for more infomation visit please https://devdocs.magento.com/guides/v2.0/extension-dev-guide/build/module-load-order.html