Solving the COF trilemma: towards crystalline, stable and functional covalent organic frameworks

Covalent organic frameworks (COFs) have entered the stage as a new generation of porous polymers which stand out by virtue of their crystallinity, diverse framework topologies and accessible pore systems. An important – but still underdeveloped – feature of COFs is their potentially superior stability in comparison to other porous materials. Achieving COFs which are simultaneously crystalline, stable, and functional is still challenging as reversible bond formation is one of the prime prerequisites for the crystallization of COFs. However, as the COF field matures new strategies have surfaced that bypass this crystallinity – stability dichotomy. Three major approaches for obtaining both stable and crystalline COFs have taken form in recent years: Tweaking the reaction conditions for reversible linkages, separating the order inducing step and the stability inducing step, and controlling the structural degrees of freedom during assembly and in the final COF. This review discusses rational approaches to stability and crystallinity engineering in COFs, which are apt at overcoming current challenges in COF design and open up new avenues to new real-world applications of COFs.


Introduction
As COFs are coming of age, conceptual advances in their design and the diversity of synthetic protocols have established COFs at the forefront of modern porous materials research. While in principle COFs have proven competitive to metal organic frameworks and zeolites in terms of their functional group tolerance, structural tunability and stability, achieving these features within a covalently connected, crystalline backbone is still a formidable challenge. 1 The advantage of covalent connectivity is that it makes COFs robust and creates a versatile platform for tuneable materials design, as the building blocks assemble in a predictable manner. However, the combination of covalent connectivity with crystallinity in COFs requires special functional groups and reaction conditions, which typically are designed for reversible covalent bonds. When invoking dynamic covalent chemistry (DCC) for COF design based on reversible bond forming reactions, a tradeoff is usually observed between crystallinity and stability, 2 which has been a bottleneck to the development of new COFs for applications: We call this ubiquitous feature of COF chemistry the ''crystallinitystability dichotomy''. But even engineering crystallinity and stability individually is challenging in itself. COFs are typically obtained as powders with crystallite sizes in the range of several hundred nanometres. 3 Within one crystallite, crystallinity is defined by the amount of disorder and defects, and hence the porosity of COFs. While the possibility to precisely position functional groups within the crystal lattice and the pore is a hallmark of COFs, this feature is lost if disorder prevents structural control.
Crystallinity is also central to characterizing COFs, which is usually done by powder X-ray diffraction (PXRD) in combination with structure modelling and Pawley or Rietveld refinement, or very rarely by single crystal diffraction. 4 Even for characterization techniques that do not rely on crystallinity such as solid-state NMR, a reduced line width in highly crystalline materials can improve the information that can be extracted from the measurements, 5 thereby allowing for a better understanding and prediction of properties.

The crystallinity, stability and functionality trilemma in COFs
In COFs the three features of crystallinity, stability and functionality are competing with each other, if the COF is synthesized by reversible reactions (Fig. 1). Crystallinity and stability are inversely related to each other, as an increased reversibility leads to higher crystallinity and lower stability, and vice versa. By improving the reversibility, the building blocks and the COF linkages can rearrange to adopt the thermodynamic minimum structure, consistent with improved crystallinity. At the same time, the reversibility negatively influences the stability, as the cleavage of the COF linkage is simply the reverse of its formation, such as hydrolysis of a linkage that is formed in a condensation reaction. Both crystallinity and stability are also competing with functionality in a less obvious way. Stability is a feature that has to be assessed in the context of the operating temperature and conditions of a desired application. 6,7 If a material can be operated at significantly milder conditions than those applied during its synthesis, then reversibility during the synthesis has little impact on the stability. This is the case for materials such as diamond, which is an extremely stable material at room temperature (although metastable) while it is synthesized at a temperature above 2000 K. 8 Synthesizing stable COFs with the help of reactions that are only reversible at significantly higher temperatures or under harsher conditions 9,10 limit the types of functional groups and functionalities that can be installed in a COF due to their chemical and thermal decomposition during the synthesis. 11 Thus, a trilemma exists for the formation of COFs in terms of achieving crystallinity, stability and complexity (implying functionality) at the same time, if one limits oneself to only reversible reactions. A way to escape this trilemma ( Fig. 1) involves strategies that lead to ordered structures, but are not completely dependent on reversible reactions (see Section 3.2).
Since balancing crystallinity, stability and complexity in COFs has played an important role since the inception of this material class, several strategies have been developed from early on in the field to improve the stability while maintaining crystallinity. Stability and the lack thereof can be linked to three pathways by which important COF features such as order, porosity and connectivity are lost ( Fig. 2): bond breakage, stacking breakdown, or flexible pore collapse. How to avoid these failure modes will be addressed throughout this review. The bond breakage of COFs can be addressed by creating strong covalent bonds or stabilizing them, as discussed in Section 3.1 and throughout this review, stacking breakdown 15 Fig. 1 The trilemma of materials design for COF synthesis based on reversible reactions (left). Strengths of bonds that are used for the synthesis of molecularly defined materials (right). [12][13][14] can be mitigated by designing the stacking interactions as described in Section 6.3.4, and the flexible pore collapse 16 can be avoided by reducing the number of conformers as described in Section 6.3. Central to escaping this apparently inescapable challenge is to understand the formation principles that govern the synthesis of complex ordered and stable materials as will be introduced in the following and elaborated on further below. 17,18

Formation principles of COFs
The general design of COFs has been discussed extensively in a number of excellent reviews. 1,[19][20][21] A typical approach as proposed by Diercks et al. 1 involves the retrosynthetic disassembly of the target topology into individual building blocks and matching these with molecular equivalents to construct the target COF. Alternately, possible nets and structures are constructed starting from a given molecular building block carrying a desired functionality. Central to both strategies are the number of functional groups used in a building block to propagate the growth of a COF (points of extension), its geometry and the specific combination of different building blocks. The target net with its connectivity has to be able to accommodate the target building blocks without significant distortion to enable the facile synthesis of the material. 22,23 In addition, the building blocks need to be connected by a covalent COF linkage that is compatible with the synthesis of a crystalline material, which is usually achieved by a reversible reaction.
In recent years, strategies for the formation of ordered materials by other means than relying on reversible reactions have gained attention. New synthetic approaches to ordered covalently connected materials promise improved crystallinity and stability in COFs, and at the same time tolerate chemical functionalities that would be incompatible with reversible reactions. The approaches to obtain crystalline COFs can be classified into three strategies (Fig. 3): reversible reaction, preorientation of building blocks and the single reaction pathway. In each class, examples exist that only use a single strategy to obtain a crystalline material; however, the strategies are often used in conjunction with each other, or design principles derived from one strategy can be generalized for other COF syntheses.
In the following, we will briefly summarize the key features of each strategy which will then be discussed in detail in the following sections, along with pertinent examples: Crystallization of COFs by reversible covalent bond formation (see Section 4) is the most prominent strategy for constructing highly crystalline COFs. A reversible reaction enables continuous bond formation and breakage and, hence, defect healing during the assembly of the building blocks, such that the system can finally arrive at the thermodynamic equilibrium structure. Using reversible covalent bonds for the crystallization of COFs is the most prevalent mechanism in producing ordered materials and is the generally accepted rationale for crystallinity in COFs. 3,[24][25][26] Pre-orientation of building blocks (see Section 5) separates the assembly step from the formation of strong covalent bonds. Building blocks are first aligned by using weak interactions that make the ordering step highly reversible and allow for facile crystallization. In a second step, the building blocks are connected with each other by stronger bonds. This strategy ranges from the formation of molecular crystals which are then crosslinked photochemically, to crystallizing COFs by reversible reactions and subsequently transforming the labile linkage into a more stable linkage by an irreversible reaction.
The formation of COFs by a single reaction pathway (see Section 6) describes the conformational design of COFs and their constituent building blocks in such a way that attachment of building blocks can only occur in only one -the correct -position  and orientation, making reversibility of the connecting linkage optional. Building blocks are typically aligned by using a strong connection to the other building blocks and order is achieved by a low number of conformational degrees of freedom. By reducing the number of possible conformers, this strategy has also been successfully applied in improving the crystallinity in COFs based on reversible reactions. Notably, this strategy allows for the formation of COFs based on completely irreversible reactions -a strategy that complements and extends the chemistry of COF formation significantly.

Reversible covalent bond formation
The typical approach to designing crystalline COFs takes advantage of dynamic covalent chemistry ( Fig. 4 and 5), i.e. it relies on reactions that allow for the reversible covalent bond formation during the synthesis. The reversible bond enables the building blocks to arrange in the thermodynamic minimum configuration (Fig. 4). If the structure is not crystalline or contains defects, dangling bonds and off-equilibrium structures are produced, which are energetically less favourable than the corresponding ordered structure. This energy gain drives the formation and crystallization of the structure.
Dichtel and co-workers have investigated the formation mechanisms of COFs that help understand and design the reaction process to improve the crystallinity in COFs. COFs are built from strong covalent bonds, which can lead to a large driving force for bond formation and quick kinetic trapping of the building blocks in a disordered state. 18 In boronic ester COFs, sheet-like oligomers and crystallites form first under reversible conditions in solution, and then precipitate by stacking and aggregation, after which further crystallization is kinetically limited. 18 In the case of imine COFs, however, the mechanism follows a different route: The quick formation of an amorphous polymer is followed by the slow transformation into a crystalline material. 2,17 Based on the paradigm of reversible covalent bond formation governing the synthesis of crystalline covalent organic materials, many new reactions have been developed since the first COFs were demonstrated, which will be discussed in the following.

Reversible reactions for the formation of COFs
The linkage responsible for connecting the individual building blocks to form the COF is the so called ''COF linkage'' (Fig. 5). Many types of reversible covalent bond forming reactions are known from DCC, but in the original field of molecular DCC, the requirements on rigidity are not as stringent. COFs, however, rely on a rigid and ordered backbone, which is why many of the reactions found in DCC cannot directly be applied to the COF synthesis. Rigidity and directionality play an important role in the crystallization of the COF and will be discussed separately in Section 6.
A range of reactions ( Fig. 6) has been explored and reported for the synthesis of COFs since the seminal report by O. Yaghi and co-workers in 2005 3 who used boronic ester and boronic acid anhydride formation to design the first COF. The COF field was initially focused on borate COFs, but quickly expanded to include imine linkages since their development in 2009, which currently dominate the COF field. Linkages based on the formation of carbon-carbon double bonds are experiencing a surge of interest since their development in 2016. Beyond these archetypical COF linkages, many more have been developed over the years, while many have only been demonstrated in one or very few COF systems.
The boronic ester and boronic acid COFs were attractive as a first target for the formation of COFs due to their very high reversibility which led to much more crystalline materials than their imine counterparts that followed them. 3 However, it is precisely this improved reversibility that also made them prone to hydrolysis under ambient conditions, thus putting their suitability for certain applications at stake. 27 Based on the excellent reversibility of bonds formed with boronates or anionic silicon species such heteroatom containing building blocks have remained of interest to the COF community ever since. The most prominent examples include the formation of borosilicate 25 and borazine, 24 as well as ionic spiroborate 28 and silicate linkages. 26 These linkages present a borderline case towards metal organic frameworks, and as such share improved crystallinity and hydrolytic lability with them. 29 The currently most common COF linkage is based on the formation of a nitrogen-carbon double bond from a variety of Fig. 4 Reversible COF formation by slow crystallization. First, an amorphous gel is formed that then slowly crystallizes. This crystallization mechanism corresponds to the formation of imine COFs.

Fig. 5
The imine condensation reaction, which is a prototypical reversible reaction that is used for the formation of COFs.
carbonyl compounds and amines. The archetype of this reaction is the imine formation from an aromatic amine, like aniline, and an aromatic aldehyde. Many variations of this motif have been developed that differ in their crystallinity and stability. Adjacent functional groups and the type of the used nitrogen functionality alter the properties of the imine linkage significantly, such as bulky hydrophobic side chains that stabilize imine COFs by blocking the attack by water. 30,31 Deviations from the prototype imine linkage have been explored that often improve the stability of the bonds towards hydrolytic cleavage, but at the expense of the crystallinity.
Several variations of the imine linkage relying on a H 2 N-N motif have been reported, which lead to an increase in hydrolytic stability. Examples include hydrazine giving rise to an azine linkage, 32 aminoamide forming the imidoimine linkage, 33 and the hydrazone linkage formed from carboxylic acid hydrazides or from phenyl hydrazines. 34,35 Phenazine formation from ortho diones with ortho diamines has been used for the formation of COFs. 36,37 This leads to the formation of two imine bonds in one COF linkage and the formation of an aromatic ring that improves the stability of these systems significantly in comparison to imines, while they often display poor crystallinity. Imine linkages have also been stabilized by the introduction of an ortho hydroxy group to the aldehyde that leads to keto-enol tautomerism and intramolecular hydrogen bonding that stabilizes the bond. [38][39][40] The most popular linker with this functional group, triformyl phloroglucinol, was developed by the Banerjee group. [38][39][40] This tridentate linker was used for a wide range of COFs due to the good stability of the formed COFs. 40 The enhanced robustness is associated with intramolecular hydrogen bonding in the favoured keto form, which is obtained by a facile switching from the enol to the keto form on reaction with the amine. Instead of an aromatic ortho hydroxy aldehyde, a Michael system can also be used to stabilize imine linkages through tautomerization and intramolecular hydrogen bonding. 41 A special case of the imine condensation is the formation of an aminal-linked COF by the use of a secondary rather than a primary amine and an aldehyde. 42 As the piperazine molecules connect two adjacent aldehyde moieties, this type of COF linkage can also be considered to be the first example of a one dimensional secondary building unit, a feature frequently encountered in metal organic frameworks but not in COFs. 43 Instead of a typical amine, an urea functional group can be used in combination with an ortho hydroxy aldehyde, leading to COFs with good stability towards acids. 44 Imine linkages can be further stabilized by reacting them in situ to the oxazole linkage, which leads to higher stability in comparison to the amine, but also lower crystallinity, as will be discussed in Section 5.2. Similar to the formation of the oxazole linkage, the tetrahydroquinoline linkage is formed by the in situ cascade Povarov reaction. 45 Here, an amine and an aldehyde form an imine, which further reacts with ethyl vinyl ether to form the tetrahydroquinoline COF linkage. The linkage confers significant stability towards even strong acids and bases. Since the linkage is formed in situ and not in a two-step process, the crystallinity of the obtained COFs is limited.
Amide linkages have been used to form COFs even though they typically suffer from low reversibility of the amide bond, 46 due to their higher resistance towards acid and bases compared to imines. The reduced reversibility can be compensated by the use of high reaction temperatures of 4200 1C. 9 Other examples of amide type linkages are imides, 47 squaraines 48 and cyanuric amide, 49 where the latter reaction can also be considered a nucleophilic aromatic substitution of a triazine. A special case of the amide linkages are the imidazole linkages, which can be formed from an ortho diamine and a carboxylic acid synthesized in pyrophosphoric acid, where the highly acidic conditions ensure the reversibility of the reaction. 50 This linkage offers highly stable materials, but the harsh reaction conditions limit the substrate scope for this linkage.
Linkages based on aromatic systems composed of alternating carbon and nitrogen atoms can be used for the synthesis of COFs. These ''carbon nitride'' type linkages are based on the triazine and heptazine building blocks that are characteristic of the family of materials known as carbon nitrides. 51,52 The most common example is the triazine linkage, giving rise to covalent triazine frameworks (CTFs), which are typically formed either by cyclotrimerization of nitriles by zinc chloride or from carboxylic acid amides with phosphorous pentoxide at high temperatures of up to 500 1C. 51,53 These extremely harsh conditions lead to partial carbonization of the materials and low crystallinity. 54 Milder conditions are achieved by using superacid catalysis with trifluoromethanesulfonic acid or by the formation of the triazine unit from multifunctional benzyl alcohols that react with amidines, by slow in situ oxidation. 54,55 Such conditions lead to very stable materials, but make for poor functional group tolerance. Further, the crystallinity of CTFs is typically limited, and so far only a few out of the many reported CTF materials are crystalline. 10,[55][56][57][58] Heptazine linkages can also be formed by the reaction of nitriles with diamino triazine terminated building blocks. 59 The synthetic conditions are similar to carbon nitride synthesis in that ionothermal conditions are used with high temperatures up to 500 1C. 10 A reaction that has gained much recent attention is the formation of vinylic carbon-carbon bond by Knoevenagel reaction between an activated CH 2 group and an aldehyde, which have been demonstrated with cyanomethyl groups, 60 trimethyl triazine, 61 and trimethyl dicyanopyridine. 62 The vinylene based COF linkages possess more favourable hydrolytic stability in comparison to the corresponding imine COFs. 61 The Zincke reaction is a synthesis method that produces quarternized pyridines, which can be employed for the synthesis of COFs. Here, a pyridine is activated by reaction with a dinitro phenyl group and subsequently reacts with aromatic amines replacing an amino dinitro benzene unit, leading to the formation of charged COF backbones. 63 As the bond is only reversible under special reaction conditions, the obtained COFs were shown to be stable towards water, acids and bases. Phosphazene linkages have been employed based on the reaction of a hexachloro phosphazene molecules with aromatic amines to form a 2D COF. This COF was shown to be stable towards dilute acids. 64 Highly reversible linkages have been reported, which are key to obtain single crystalline COFs, albeit at the expense of stability. An example is the nitrosyl dimerization that can be used to crystallize large single crystalline COFs from multifunctional nitroso compounds. This reaction can be seen as an extreme case of reversibility in COFs as the covalent bond is very weak (20-30 kcal mol À1 ) and COF assembly from solutions of the precursors is reminiscent of the growth of regular molecular organic crystals. 65

Increasing the reversibility of the COF formation reaction
Drawing on the insights gained from mechanistic studies and the fact that the crystallization of many COFs crucially depends on reversibility, several reaction design principles exist to improve COF crystallinity by improving reversibility. In this context, studies of imine-linked COFs have been at the forefront for improving the crystallinity of COFs due to their wide adoption in the COF community.
2.2.1. The role of water. Systematic studies by Dichtel and co-workers 17 have revealed that adding increasing amounts of water favours the back reaction in COFs, thereby improving COF crystallization (Fig. 7). The addition of an acetic acid catalyst without water led to the formation of amorphous imine polymers enabled by the rapid forward reaction. Only when a sufficient amount of water was added in addition to the catalyst, an ordered material was obtained. These results emphasize that the water released through imine condensation alone may not be sufficient to enable the back reaction and thereby crystallization. The same crucial effect of water has also been shown by simulating the formation mechanism of boronic ester based COFs. 66 In amide COFs it was reported that the control of the water vapor pressure is essential in obtaining crystalline COFs. 9 Here, it was shown that amide COFs can be formed from an amorphous prepolymer by reacting it in a sealed tube with a controlled amount of water to obtain COFs with good crystallinity.
2.2.2. The role of the catalyst. Besides the typical acetic acid catalyst used for imine COFs, alternative catalyst systems have been explored. In principle, acetic acid is known to be an inefficient catalyst for the transamination reaction. 67 Different Brønsted acids can be used, such as sulfonic acids as demonstrated by Banerjee and co-workers. 68,69 Lewis acids can also be employed as catalysts for the formation of boronic ester COFs 70 and imine COFs. 67 The synthesis of imine COFs by Lewis acid catalysis showed significantly improved crystallinity and higher porosity compared to COFs obtained by catalysis with acetic acid, as judged by their higher BET surface areas and narrower pore size distributions. 67,70 Several Lewis acid catalysts based on metal triflates (M = Sc, In, Yb, Eu) were investigated, which showed fast conversion to the corresponding COFs at low loadings and low temperatures. Especially Scandium triflate performed well as a transamination catalyst, but not all tested COFs benefitted from the use of a Lewis acid catalyst as compared to the acetic acid catalyst, making a generalization of these findings difficult. Instead of acidic catalysts it is also possible to use pyrrolidine as a catalyst, which has been used for imine and keto enamine COFs. 71 Imide COFs can be synthesized under basic conditions catalysed by isoquinoline, which is in contrast to most imine COFs that require Brønsted or Lewis acid catalysis. 47 Recently, a new synthetic route to imide COFs has been reported based on ionothermal synthesis using ZnCl 2 or eutectic salt mixtures. 5 2.2.3. Enhancing reversibility. Bein and co-workers 72 applied a modulator approach to improve the crystallization by slowing down the growth of the nuclei and favouring the back reaction in the synthesis of boronic ester COFs. The introduction of monodentate boronic acid in addition to the bidentate boronic acid linker lead to sharper reflections in PXRD, higher BET surface areas and larger domain sizes as observed by TEM. The modulator slows down the growth of the COF crystallites by rapidly attaching to their surface, thereby reversibly inhibiting the attachment of new linkers.
Banerjee and co-workers 68 devised a method that favours the back reaction by transforming the amine into a salt of p-toluenesulfonic acid. The p-toluenesulfonic acid hereby acts simultaneously as a catalyst, as a templating agent, as an inhibitor of the COF forming reaction, and as an agent that favours the back reaction. The protonated amine first needs to be deprotonated to be able to participate in the formation of the imine bond in the COF, thereby slowing down the initial reaction. In addition, the presence of this strong acid regulates the equilibrium of imine formation and hydrolysis by favouring hydrolysis through protonation of the free amine. Through this strategy the crystallinity of twelve different COFs was improved, which confirms the wide applicability of this method. This so-called organic ''terra cotta'' process allowed for improved surface areas by two to three times in comparison to the conventional solvothermal process.
The use of modulators for the synthesis of COFs as discussed above has laid the grounds for the work of Wang, Sun, Yaghi and co-workers who were able to grow COF single crystals large enough to be analysed by single crystal X-ray diffraction (Fig. 8). 4 The reaction equilibrium of the imine forming reaction was tuned by addition of a monodentate aniline to such an extent that the X-ray single crystal structure solution of 3D imine COFs was successful for the very first time -a milestone in the structural chemistry of COFs. This study revealed the atomic structure of two 3D imine frameworks and their degree of interpenetration. The monofunctional amines used in the reaction compete with the linker in the formation of the imine product, thus slowing down the reaction and increasing the back reaction. In order to obtain crystallinity enhancements by the addition of the modulator, several anilines were tested and only those that matched the reactivity of the linkers led to crystallinity enhancements. Otherwise, reduced crystallinity was observed or even amorphous materials were obtained.

Pre-orientation of building blocks
The synthesis of amorphous materials based on strong covalent bonds under non-reversible conditions is straightforward, as well as the crystallization of materials by using only weak interactions, due to the high reversibility. The pre-orientation strategy separates the ordering and the (irreversible) covalent bond formation into separate steps that are performed in sequence. By this approach, the best of both worlds can be achieved, obtaining highly crystalline and highly stabile COFs.
In the order inducing step, the building blocks are oriented and ordered by a highly reversible reaction ( Fig. 9, left). This pre-oriented intermediate may show different degrees of fragility, depending on the type of reaction used to form the ordered state, ranging from non-covalently bonded molecular crystals ( Fig. 9A) all the way to weakly covalently bonded solids (Fig. 9B). In the stability inducing step, the building blocks of the previously formed ordered assembly are linked with strong bonds often by an irreversible reaction ( Fig. 9, right). By the choice of the reaction and the reaction conditions, the previously obtained order is maintained and locked in place.
Pre-orientation has been used in a variety of material classes, but has recently gained momentum in the COF field due to works showing the feasibility of linkage conversion in COFs. The underlying principle of pre-orientation is closely related to classical templating which has been explored for the synthesis of mesoporous silica 73,74 and two-dimensional polymers. 75,76 These examples however demonstrate only long range order while the materials are commonly disordered on molecular length scales. By influencing the interactions of reactive building blocks on a molecular level, it is also possible to induce short range order and produce crystalline materials that would be difficult to synthesize by other means. In zeolites this approach has been used to synthesize 'unfeasible' zeolites 77 by pre-orienting exfoliated crystalline layers by the addition of ionic stacking modulators that influence the stacking sequence. This pre-oriented assembly is then locked by irreversibly reacting the sheets with each other through reactive silanes. This approach allows for the synthesis of crystalline zeolites that would be unfeasible to synthesize by direct solvothermal approaches. 77,78 Similarly, in the synthesis of linear polyamides, significant improvements in crystallinity have been obtained by first preorienting the precursors as molecular salts based on ionic ammonium and carboxylate groups. These pre-oriented materials are subsequently heated to generate the polyamide, thus transferring the pre-oriented crystalline state into the stable polyamide. 79 These examples demonstrate how pre-orientation can be used from the meso down to the molecular scale to obtain crystalline solids.
In self-assembled cages this approach has been used to lock the linkages within the cage that where formed under reversible conditions. It has been demonstrated that the linking groups can be transformed into different functional groups with varying stability and rigidity. A first example is the reduction of imine linkages to amines which improves the stability of the cage, but reduces their rigidity. 80 Even multistep reactions can be performed on these cage linkages, for example with an ortho hydroxy group participating in a multistep procedure of irreversible reactions to form a stabilized carbamate linkage (Fig. 10A). 80  The reduced amine can also be transformed into a pure hydrocarbon linkage by the extrusion of nitrogen with the help of isoamyl nitrite (Fig. 10B). 81 This widespread pre-orientation strategy is dependent on four prerequisites (Fig. 11): The reversible assembly does not disassemble under the conditions of the stability inducing step; the building blocks are oriented correctly to allow the reaction to occur; the order in the material needs to withstand forces generated during or because of the transformation; the reagents and catalysts need to reach the COF linkage and need to be able to perform the reaction irrespective of the sterically challenging environment.
In order to stabilize a system ordered by comparably weaker interactions, disassembly during the stability inducing reaction needs to be circumvented. In ordered crystals of molecules, which are only connected by weak interactions, this is often achieved by using a photochemical reaction in the solid state. [82][83][84] This way the order of the crystal is not affected by solvents or reagents. When transforming a COF based on reversible linkages into a material connected by irreversible linkages, it is often beneficial that most COF linkages are formed by condensation reactions, and thus by excluding water during the locking reaction it is possible to avoid disassembly.
In examples based on weak intermolecular forces, obtaining correct orientation of the building blocks in the solid state to enable the stability inducing step is not trivial and often not amenable to design. Here, sometimes extensive screening of crystallization conditions, such as solvents are required. 82 In COFs the strong covalent bonds between the building blocks lead to very well-defined orientations of the building blocks that allow the tailored design of reactive sites and reactions in the solid state, when locking the COF linkages with an irreversible reaction. Furthermore, it was shown that even in the solid state the orientation of linkers or the imine group are to some extent dynamic and hence can change, making the reaction possible even with initially misaligned building blocks. 16 Nevertheless, if multiple orientations of a building block are possible, it may limit the conversion of the COF linkage.
The transformation of the pre-oriented assembly can lead to strain on the material due to changes in the bond length and angles by the transformation itself. 82 For example, the formation of an oxazole or a thiazole from an imine linkage by oxidative cyclization leads to a significant change of the angle in the backbone of the COF (Fig. 16), which in turn results in a contraction of the unit cell. 2 In molecular crystals, which are mechanically fragile, even relatively small changes in the unit cell dimensions can lead to the fracturing of the crystal and thereby the loss of order. 82 This is especially true if the stability inducing step follows a nucleation and growth mechanism, as  even a small change in bond angles or unit cell size would build up considerable strain that could lead to the fragmentation of the crystallites. However, if the transformation occurs randomly within the crystallite or if the crystallite can withstand the strain build-up during the linkage transformation, the order remains. A further challenge can be the loss of rigidity during the linkage transformation, as seen with the reduction of the COF linkage from an imine to an amine. This can lead to a loss of crystallinity as observed in a 2D COF while the topology of the connection was maintained. 16 This was proven by the re-rigidification of the COF linkage leading to the recovery of the crystallinity. In contrast, the crystallinity was maintained after the reduction to the amine in other 2D and 3D COFs, which clearly shows that the effect of losing crystallinity depends on the framework. 85,86

Pre-orientation in COFs based on weak interactions
Pre-orientation has been used in the synthesis of crystalline two-dimensional polymers by creating molecular crystals of precursors that can in a second step be crosslinked in a topotactic single-crystal-to-single-crystal transformation (Fig. 12). This approach enables the synthesis of covalently crosslinked crystalline polymers by means of an irreversible reaction. This approach has been demonstrated with the photochemical dimerization of anthracenes or by the cycloaddition between anthracenes and alkynes. [82][83][84]87 This elegant approach allows for the synthesis of highly crystalline, extended covalently linked polymers with millimetre sized single crystals. 82 These two-dimensional polymers additionally possess nanopores. 87 However, the feasibility of this method is highly dependent on the molecular orientation of the molecular units and reactive functional groups in the solid state, which currently cannot be predicted in a facile manner, thus making these materials difficult to design from scratch.
It is precisely this predictability inherent to COFs that has been one of the driving forces in making them so popular among organic and solid-state chemists alike. To benefit from these strategies in the synthesis of COFs, a number of approaches have been developed to implement strategies of pre-orientation into the synthesis of COF.
A directional and specific interaction between molecules has been designed for the two-step formation of a 3D COF, where linkers with multiple vinyl-pyridinium groups are assembled into a non-covalent 3D lattice by the help of the host-guest chemistry of cucurbituril (Fig. 13). 88 This assembly is then covalently linked by photodimerization of two vinyl groups, leading to a framework that is covalently connected in three dimensions. This approach shows that weak interactions can be designed to place reactive functional groups in close spatial proximity, allowing their reaction with each other.
The assembly of precursor molecules in the solid state can be used as a template for the oriented growth of 2D imide COFs (Fig. 14). 89,90 The assembly of porphyrin building blocks at the air/water interface with the help of surfactants can successfully pre-orient the building blocks for the formation of a crystalline COF. The orientation of the COF follows the orientation of the precursors and is dependent on the used surfactants. The use of sulfonate surfactants promoted the assembly parallel to the interface, while carboxylic acid surfactants led to growth of the precursors and COFs perpendicular to the surface. This approach led to micron sized COF crystallites that are only 2 nm thick. The pre-orientation of the precursors at the interface allowed the COF forming reaction to proceed under exceptionally mild conditions, especially for imide COFs, with the reaction occurring at room temperature over a course of 7 days.
The crystallization of amine precursors as p-toluenesulfonic acid salts serves as another means to pre-orient the amine molecules for the reaction to an imine based COF. 68 As the distance between individual amines in the salt crystal structure matches well with the distance of the aldehyde precursor, the lattice of the tosylate salt is transformed into the COF lattice by replacing the tosylate molecules by aldehyde building blocks (Fig. 15). According to the proposed mechanism, the amine building block gets deprotonated and the weak hydrogen bond is replaced with a stronger covalent bond resulting in an iminelinked framework. The crystallinity only becomes evident after washing the COF, indicating residual acid and precursors in the pores, which further underscores the mechanism.
''Woven'' COFs are composed of linear covalently connected chains that are oriented relative to each other by metal coordination bonds. 91,92 The synthesis of these COFs utilizes the coordination bonds to pre-orient sections of the linear chain, relative to each other, drawing on the chemistry developed for catenates. 93 These pre-oriented chain sections are then linked by the COF linkages into an ordered covalently connected lattice. The connectivity within the lattice ensures mechanical interlock between the woven strands. The metal required for the pre-orientation can be removed after the polymerization and the topology, but the crystalline order of the strands is not preserved. It was shown that the chain sections need to be pre-oriented in a separate step to arrive at an ordered lattice, since if the orientation of the building blocks is performed during the crystallization, no ordered structure is obtained. 92 Pre-orientation can also be used after the formation of a twodimensional COF to form a 3D COF by photodimerization of anthracene building blocks placed in adjacent layers. 94 The face-to-face arrangement that is achieved through the stacking Fig. 13 Pre-orientation of a cationic tetraphenyl methane derivative with vinyl functional groups that forms an inclusion compound with cucurbituril with each of its four appendages. This 3D supramolecular network is then transformed into a covalent framework by [2+2] photodimerization of the vinyl functional groups that have been pre-oriented within the cucurbituril. 88 Adapted with permission from ref. 88. Copyright (2020) American Chemical Society. of the individual COF layers enables the dimerization without significant rearrangement. This pre-orientation of functional groups allows the transformation of a van der Waals-stacked structure into one that is connected covalently in 3D. In a similar manner, vinyl groups in a 2D COF can react in a 2+2 photoaddition to connect the layers of the COFs with each other. 61

Pre-orientation based on covalent bonds for the locking of COF linkages
The pre-orientation in COFs shown above were primarily used to improve the crystallinity and not focused on improving the stability. In contrast, chemical transformation of a reversible into an inert COF linkage is a powerful tool for drastically enhancing the stability of COFs. The COF linkages are ideal targets for a pre-orientation strategy, since the assembly of COFs by reversible reactions is now well established, while the chemistry of the COF linkages is well known from their molecular counterparts.
The strategies for locking of COF linkages can be classified by either the type of locking procedure or by the generality of the approach. The type of transformation can be differentiated into two categories: The first is altering the chemical nature of the COF linkage itself, without the introduction of additional bonds between the linkers, such as with the reduction of an imine linkage to an amine linkage (Fig. 16, red). 16,85 The second strategy creates additional bonds between the linkers that are parallel to the existing COF linkage, as with the cyclization of an imine to a thiazole, where the sulphur atom formally creates an additional connection between the amine and the aldehyde building blocks (Fig. 16, blue). 2 The generality of the locking reaction depends on whether a reactive functional group needs to be predesigned into the building block, or whether a typical unfunctionalized COF can be used in a locking procedure (Fig. 16, grey). The general methods are those that alter the nature of the COF linkage, such as the coordination of a pyridine Lewis base to a boronic ester, 95 the reduction of an imine to an amine, 16,85 or the oxidation of an imine to an amide. 46 Among the general strategies are also bridging reactions that do not require special functional groups such as the formation of a thiazole with sulfur 2 or of a pyridine with an acetylene 96 from the corresponding imine. Building block-specific reactions are the formation of an oxazole 97,98 or a thiazole 97 from the ortho hydroxy and ortho thiol amines, respectively. Both functional groups can also be introduced into the COF via post-synthetic linker exchange, however the challenging synthesis of these functional groups makes these locking procedures less accessible. The post-synthetic locking can also be performed as a multistep reaction if the abovementioned criteria are maintained for each step. 16 An ortho methoxy imine COF was transformed into a carbamate or thiocarbamate by first removing the methyl group, exposing a free hydroxyl group, and subsequently cyclizing the COF linkage to the final (thio)carbamate linkage. Another reaction based on a building block predesigned for locking is the oxidative cyclization of an imine COF with pendant thiophene groups that allows the locking of the imine group into an extended heterocyclic aromatic system. 99 The transformation of the COF linkage, especially in the case of the imine transformations, was generally accompanied by the retention of crystallinity and porosity. While in some cases the porosity was reduced by the transformation, 46 in other cases it increased, possibly due to the transformation reaction cleaning the pores. 2 In all reported cases, the stability of the COFs was drastically improved with regards to their parent compounds, but also with regard to other reported COFs. The locked COFs were shown to be stable against strong aqueous acids, bases, nucleophiles, electrophiles, reducing and oxidizing conditions. These results nicely demonstrate that locking the COF linkage can solve the stability issues in COFs.
The stabilization inducing step can also be made by a linker exchange reaction, within the preformed COF network such as by the formation of an imine COF where the aldehyde linker is subsequently linker exchanged with an orthohydroxy aldehyde building block, leading to stabilization of the imine linkage by intramolecular hydrogen bonding and the keto-enamine tautomerization. 100 While it is possible to directly synthesize crystalline imine COFs based on orthohydroxy aldehyde building blocks, the separation into two steps is able to produce materials with a much higher crystallinity.

Single reaction pathway
Besides reversible reactions and pre-orientation, a third strategy can be distinguished based on the reaction of highly rigid molecules with only few conformational degrees of freedom. 101,102 The assembly of these building blocks allows for only very few conformational degrees of freedom when forming a framework, leading to an ordered lattice even in the absence of reversibility (Fig. 17). In other words, the ordered arrangement of the building blocks is the most probable or the only possible outcome of the reaction.
Normally, the reversibility of the reaction allows for defect healing and ordering under thermodynamic control, during the formation of a crystalline material. But such error correction is not always available with irreversible reactions or even in some COFs based on reversible reactions. The predesigned COF linkage ensures that attachment of a new building block occurs at the correct position, but as soon as two building blocks are attached at adjacent positions on the crystallite two possibilities arise from the available unsaturated functional groups (Fig. 17B): adjacent building blocks can react with each other (internal linking) or a new building block can be added to one of the free functional groups. If the addition occurs at the same site that could be used for internal linking, it creates a defect site. Multiple additions with less internal linking could be likened to a dendrimer type growth of the structure that leads to a reduction in order, because the building block addition can trap the incompatible conformer. 103 The possibility of dendrimer type growth depends on the flexibility and possible  conformers of the surface attached building blocks, which are not compatible with the desired structure. The flexibility of the building block therefore plays a major role in determining the crystallinity of a COF based on irreversible and to a lesser extent in COFs based on reversible reactions. Strategies for reducing the number of conformers and degrees of freedom in building blocks and in COFs will be discussed in detail in Section 6.3. Another consequence of the competition of building block addition with internal linking is the dependence of the formation of crystalline materials by irreversible reactions on the concentration of the building blocks during the synthesis. The rate of internal linking is concentration independent, but the rate of addition increases with the building block concentration. The slow supply of building block can reduce trapping of misaligned building blocks, and additionally favours growth at the existing particles instead of reacting in solution leading to larger crystallites (Fig. 18). 104 As COFs based on irreversible reactions were often obtained by controlling the rate at which the precursor molecules reach the growing crystallite, this suggests that the slow addition is an essential strategy in obtaining crystalline materials from irreversible reactions (see Section 6.1). Most of the examples of materials synthesized by irreversible reactions using a single reaction pathway are 2D structures, which add degrees of freedom for the stacking arrangement, and therefore, disorder is possible (see Section 6.3.4).

Direct synthesis of COFs based on irreversible reactions
By following the above outlined strategies for designing COFs and their synthesis several COFs based on irreversible reactions have been realized. [105][106][107][108] This shows that a reversible reaction is not a necessary prerequisite for obtaining crystalline COFs. However, obtaining crystalline COFs from irreversible reactions is not straightforward, as is attested by the vast literature on amorphous polymers based on the same rigid building blocks that are used to make COFs. The benefit of using irreversible reactions is the improved stability of these COF materials that result from the lack of reversibility. Using highly rigid building blocks to obtaining crystalline COFs by an irreversible reaction was nicely demonstrated by Loh and co-workers, 106,107 who were able to couple several flat and rigid aromatic bromo precursors in an uncatalyzed Ullman coupling at high temperatures to form COFs (Fig. 19).
In this example the rigidity of the building blocks and linkages compensates for a lack of error correction and healing that would be available by reversible reaction. By designing highly rigid building blocks, the degrees of freedom during the formation of the framework are severely restricted. A growing number of examples use this design principle to form crystalline COFs based on irreversible reactions directly in solution, 102,106,107,109,110 however, many examples use special experimental setups to enable the formation of crystalline COFs.
A COF with very low degrees of freedom that is based on irreversible reactions can be grown at an interface. Carboncarbon cross-coupling reactions, which are known to be kinetically controlled and essentially irreversible, such as the Suzuki and Glaser couplings, were shown to lead to crystalline sheets by a synthesis at the liquid-liquid interface. 111 Similarly, a COF carbon allotrope graphdiyne was synthesized from benzene hexa-alkyne at the liquid-gas and the liquid-liquid interface, with micron sized crystallites in the intralayer  direction while being only a few layers thick. 112 The method used an interface to construct the nanosheets but also the slow diffusion of the catalyst to the reaction site to slow down the reaction and to allow the formation of a crystalline material.
Electrochemical deposition of a porphyrin framework was obtained by electrochemical coupling of aminophenyl porphyrin on an electrode. The aminophenyl groups couple by electrochemical oxidation to form a phenazine group resulting in crystalline COF films. The oxidative coupling led to the growth of dendritic COF structures, which nevertheless revealed facets. 113 This method avoids the reaction of the precursors in solution, which would normally compete with the growth of the already formed crystallites, thus leading to overall larger crystallites by a preferred reaction of the molecules at the surface of the COF attached to the electrode.
The irreversible Glaser coupling can be used to obtain ordered materials if the feed rate and hence the reaction rate is slowed down. 103 This was shown by using two different reaction protocols that differ significantly in their reaction rates: a Glaser coupling based on copper(I) chloride and a Sonogashira-like coupling catalysed by palladium. While the faster reaction catalysed by palladium yielded only an amorphous polymer, it was possible to obtain a somewhat ordered material with the slower Glaser coupling.

Slow supply of building block in COFs based on reversible COF linkages
In COFs based on reversible reactions, the importance of slowly providing the reactants was already observed in the first COF paper by Yaghi and co-workers. 3 Diffusion of the precursors was controlled by adjusting the solubility of the linkers by choice of the solvents. The choice of solvents in the synthesis of COFs is of paramount importance when screening for conditions that produce crystalline COFs, showing that the control of the feed rate might be important for the formation of all COFs in addition to its role in controlling the stacking equilibrium. 114 These results indicate that the reaction speed can be modulated by the choice of solvent also as a means of controlling the driving force of p-stacked COFs.
Investigation of the mechanism of formation of boronate COFs showed that once precipitation of oligomers and COF sheets occurs, only little improvement of crystallinity can be observed, indicating that further crystallization is hindered. 18 This mechanism indicates that a slowed down initial reaction rate helps avoiding kinetic trapping of a COF of low crystallinity. Based on these results, approaches have been developed for slowing down the initial reaction speed. Dichtel and co-workers 27 demonstrated that the protection of amine precursors such as benzophenone imines is able to slow down the initial reaction speed as the amine first needs to be deprotected before it can participate in the formation of the COF, thereby leading to increased crystallinity.
Slowly supplying solutions of boronic acid and diol precursor monomers by a syringe pump has been shown by Dichtel and co-workers for the formation of boronic acid COFs and imine COFs. 115,116 By this approach the nucleation and growth of the particles could be separated leading to only homoepitaxial growth of the COF crystallites. 104 This method was then successfully applied to grow COFs in suspension featuring larger single crystalline dimensions than what is normally possible. These results have similarly been shown with the growth of imine COF thin films, where only by slow addition of the precursors crystallinity could be achieved. 117 CTFs based on the reaction between aldehydes and amidines were synthesized in a crystalline form by supplying a benzyl alcohol instead of an aldehyde. The slow oxidation by air to the aldehyde during the reaction served as a means to supply the precursor at a controlled rate, enabling the formation of a crystalline framework. 54 Alternately, crystalline CTFs were obtained from amidine and aldehyde building blocks by slow addition to the reaction mixture by controlling the speed of a peristaltic pump. 118 The crystallinity increased with slower feed rates and in the TEM large ordered crystallites are visible in addition to the PXRD, while the direct solution synthesis produced a material with a much lower crystallinity (Fig. 20).

Designing COFs with a low number of structural degrees of freedom
It is known from molecules that compounds with many competing conformational polymorphs within a small energy window do not crystallize well and often form disordered solids. 119 At the same time molecules with low conformational freedom often show reduced solubility, forcing a molecule to crystallize. 82 Transferring these design strategies to COFs can be used to improve their crystallinity. The structural degrees of freedom and the effect they have on the crystallization of COFs can be easily understood by two example COF systems ( Fig. 21A and C). The first COF is based on the pyrazine formation reaction with straight and highly rigid linkers 37 while the second is based on the boronic ester formation with an angled and more flexible linker. 120 Both structures are completely flat in their equilibrium shape, but possess different propensity for out-of-plane bending due to the rigidity of their building blocks and the COF linkage ( Fig. 21B and D). During the formation of the COF, the linkers are reacting with each other to form oligomers ( Fig. 21A and C). The oligomers of the boronic ester COF have more unique conformers for a given oligomer size in comparison to the phenazine COF. All oligomers of the phenazine COF are compatible with the ''ideal'' periodic structure, meaning that no conformational rearrangement or reversible reattachment is necessary to ensure the correct positioning. The boronic ester oligomers on the other hand have multiple conformers located in close proximity on the potential energy surface. Only some of these conformers are compatible with the final COF structure, requiring defect healing to arrive at an ordered structure. Additionally, the out-of-plane rotation around the COF linkage is possible in the case of the boronic ester with a relatively small energy barrier. 114 In the phenazine system such an out-of-plane bending is accompanied by a larger energy penalty and the full rotation is only possible with bond breakage as the system is annulated. The rotation around the COF linkage or the bending of the linkers themselves can result in out-of-plane defects such as spirals in the stacking direction or 5-or 7-membered rings instead of 6 membered rings. 114 Although a comparison of these two COFs with regard to their crystallinity is difficult due to their different chemistries, systems based on the same chemistry clearly show improvement in crystallinity upon reduction of conformational degrees of freedom (see below).
The number of possible conformers affects the degrees of freedom on the local building block level and as such, the growth of the oligomers and the formation of the final COF, primarily in the form of disorder and flexibility. Thus, reducing the degrees of freedom on the building block level can have large implications for the growth of a COF and its crystallinity. The first reported COFs, based on the boronic ester and boronic acid anhydride linkage, are structures with very low conformational degrees of freedom, rendering crystallization more facile. 3 In COF reactions with only limited reversibility, a low number of conformers might even be essential in leading to crystallinity as exemplified by the examples of COFs based on irreversible reactions (see Section 6.1). The cyclotrimerization of nitriles to form CTFs has a low reversibility, 121 consequently only a few CTFs have been reported to be crystalline, and all are based on low conformer building blocks, 10,56-58 while others based on building blocks with more conformers are amorphous. [122][123][124][125] The structural degrees of freedoms that appear in COFs because of the flexibility of building blocks are largely tuneable due to the wide range of possible structures, while flexibility of the COF linkages, which are limited in number, make additional conformational degrees of freedom sometimes unavoidable. If multiple different structures are possible based on the same composition or the same building blocks, this presents an additional ''topological'' degree of freedom and the competition between these phases can also lead to low crystallinity. Finally, in 2D COFs the stacking is a strong source for structural degrees of freedom, as the stacking occurs by weak interactions Fig. 21 Comparison of conformational degrees of freedom in two COFs (A and C). A highly rigid COF based on the phenazine linkage with annulated and straight linkers (A and B). 37 A COF based on a bent linker produces many possible orientational conformers during the polymerization of the building blocks (C and D). 120 of the layers. In this section notable examples and strategies for reducing structural degrees of freedoms in COFs are discussed, which open up more subtle, yet efficient means of crystallinity control in COFs.
4.3.1. Degrees of freedom arising from the building blocks. The symmetry and the degrees of freedom resulting from building block design were shown to have an immediate influence on the crystallinity of COFs by Dinca and co-workers. 120 Comparing the crystallinity of COFs based on straight, angled, and offset linkers revealed that the straight linkers lead to the most crystalline structures (Fig. 22). In fact, the angled linkers are able to generate a much larger number of incompatible conformers than the corresponding straight linker (Fig. 21C). Similarly, Cooper and co-workers have shown that in imine COFs changing an angled linker to an offset linker already can improve the crystallinity dramatically. 126 Work by Yaghi and co-workers has shown that the orientation of some linkers can change even in the solid state, which could suggest that some linkers might have sufficiently low rotational barriers even in the solid state to rearrange to heal defects. 16 Some of the building block's inherent flexibility can be avoided by using highly rigid molecules. Highly annulated building blocks based on a triphenylene or pyrene core are extremely rigid as they can only bend out of shape with a high energy penalty but possess no rotational degrees of freedom, as opposed to building blocks that possess a connecting C-C single bond as in biphenyl (Fig. 23). The conformational polymorphism depends also on the equilibrium dihedral angle between two adjacent rings as these flexible molecules have multiple conformational possibilities within a small energy window. In the biphenyl case an optimum dihedral angle of B44 127 is observed, which leads to four energy minima for just one biphenyl linkage that can complicate the formation of the COF structure.
The dihedral angle between two adjacent aromatic rings can be controlled by managing the repulsion between hydrogen atoms of adjacent aryl rings. For 2D COFs low dihedral angles are often desired, as they can improve stacking order and, hence, crystallinity. 128 Low dihedral angles can be achieved by combining a phenyl ring with heteroatomic rings, that do not possess hydrogen atoms in ortho position to the connecting bond between both rings, such as structures based on boroxine, triazine, bipyridine, pyridine, pyrimidine or tetrazine. 3,129,130 The use of a five membered ring can also enable flat structures such as those based on thiophene. 131 The repulsion of hydrogen atoms on adjacent phenyl rings can also be reduced by introducing a separating alkyne group. 132 Common design principles of COF building blocks include the use of highly rigid building blocks that are composed of only sp 2 -or sp-carbons in their backbone to reduce the number of conformers and to increase porosity. [133][134][135] These building blocks are based on polyaromatic units together with alkyne or vinyl groups. 20,21,136 Typically, the employed building blocks have high symmetry as these tend to produce higher crystallinity in COFs, 1 while asymmetric building blocks tend to increase disorder in the COF. 129 Nevertheless, there is a rich literature in asymmetric building blocks that have been used for COF design as well. 129,[137][138][139] Linkers with sp 3 -carbons are known as well and are especially prominent for tetrahedral building blocks based on tetraphenylmethane or adamantane. 4,9,65,[140][141][142][143][144][145] These building blocks are especially important for the construction of three-dimensional COFs, as the number of rigid three-dimensional nodes other than those mentioned above are generally limited. The examples based on sp 3 -carbons still represent highly rigid building blocks as the numbers of possible conformers are restricted. 28,146 In addition, some COFs with highly flexible linkers are known such as those based on cyclohexane 9 and piperazine. 49 In general, however, the overall low number of reported COF structures with flexible building blocks suggests that the formation of crystalline and porous COFs with such linkers is more challenging. 147 4.3.2. Linkage group conformers. While considerable numbers of building blocks are available for designing COFs that have plenty of possibilities for reducing the number of conformers in them, the COF linkages are limited in both number and tunability. Many COF linkages introduce additional conformers to the structure, but the number of conformers for COF linkages differs considerably between them (Fig. 6). An extreme case in terms of the number of possible conformers arising from a COF linkage is urea-linked COFs (Fig. 24).
The imine linkage entails two orientational isomers forming flat structures (Fig. 26A) that could lead to reduced order in the COF. The flexibility of the imine linkage has been directly implicated in the flexibility observed in several COFs, thus showing their ability, in principle, to form several structural conformers. 4,148,149 This has been demonstrated with the control over the 3D structure of a COF where slightly altered synthetic conditions lead either to a dense, non-porous structure or a  porous COF, while both structures were crystalline. The structures could be switched based on the presence of water, which leads to a significant contraction of the unit cell due to changes in hydrogen bonding. 4,150 Similar switchable structures are observed with the breathing effect in a 3D COF with THF ( Fig. 25), 149 leading to conformational changes in the structure which influence the distance between the interpenetrated nets as a result of the imine rotation that can be seen as a cause of this flexibility. Similarly, flexibility of the imine linkage has been detected in early examples of 3D COFs where temperature dependent symmetry variations led to changes in the pore shape from rectangular to square. 4,148 There are however strategies to conformationally lock imine linkages in place so that the number of conformers is reduced from two to one, by using an ortho hydroxy aldehyde linker in combination with the amine, which leads to intramolecular hydrogen bonding that directs the imine bond (Fig. 26B). 38 The opposite conformational locking can be induced by using an ortho methoxy substituted aldehyde, which leads to imine groups facing away from the methoxy group (Fig. 26C). 16 However, in many cases the lock-in by intramolecular hydrogen bonding does not reduce the number of conformers, as the COF fragments containing the imine linkage can rotate such that two conformers are still available (Fig. 27A). This issue can be circumvented by building block design, when the hydrogen bonding locks the direction of the imine linkage so that a straight COF fragment is formed (Fig. 27B). 151 By designing a building block where the imine is locked either on opposing (Fig. 26A) or the same side (Fig. 26B), the conformational offset found in the trans case is eliminated in the cis case. The linker then still has two different conformers (Fig. 27B), which might influence the stacking and thereby the crystallinity. As the orientation of the linker can alternate between layers, favourable dipole-dipole interactions between layers could occur. 152 Esteves and co-workers 153 were able to show that by introducing benzene trialdehydes with different amounts of ortho hydroxy groups the crystallinity and porosity of the COFs could be improved, implying that the locking of a conformation can improve the crystallinity by reducing the number of conformers (Fig. 28).
When an imine is transformed into an amine by reduction, additional flexibility is created as a new sp 3 bond is formed. The resulting flexibility can be so substantial that the structural    integrity is lost and the structure loses its order as detectable by PXRD and porosity measurements. 16 Since the topology of the structure is maintained during this transition, it can be recovered by re-rigidifying the structure, by further reaction to a carbamate. This shows how the flexibility of the linkage groups plays an essential role for the crystallinity of COFs.
Annulated linkages such as the phenazine or the dioxane type linkage are prime examples for linkage groups that lead to only a single conformer. They possess a very rigid structure that improves the crystallinity of the structure even though the reaction has a comparatively low reversibility (Fig. 29). 154 An even higher rigidity of the COF linkage is observed in phthalocyanine COFs synthesized from ortho dinitriles. This highly rigid and essentially irreversible reaction still give rise to crystalline materials, as observed by PXRD and TEM, including ordered stacking reflections. The exceptionally rigid structure of a phthalocyanine linkage makes this a prime example for a single reaction pathway. 155 4.3.3. Nets and polymorphs. The net of a covalent organic framework describes the periodic connectivity of the building blocks that determine the structure, topology, porosity, and many other properties of COFs. The design of a COF often starts with the choice of a desired net and a set of building blocks is derived to construct the COF. However, in certain instances not only one single net or structure can be formed based on the building blocks used, leading to polymorphism, disorder or sub-stoichiometric structures. This gives the choice of the net a special role in designing crystalline COFs. In order to reduce the number of possible reaction outcomes, strategies for designing the building blocks to enable the formation of only one kind of net have been developed. 22,156 The most common nets are the hcb net, 3 sql net, 157 kgm net, 158 and hxl net 159 in two dimensions, and the dia net, 4,9,140,141,145 cnt net, 142 bor net, 142 and pts net 143,144 in three dimensions. Three-dimensional COFs are characterized by covalent connectivity in three independent directions, which leads to improved crystallinity as compared to two-dimensional COFs. The improved crystallinity can be explained by the strong directing force of the covalent bonds in all directions, while in 2D COFs in the out-of-plane direction weaker van der Waals bonds are used to construct the structure (see Section 6.3.4). However, rigid organic molecules with high 3D point symmetries are often synthetically challenging to access, 160,161 thus limiting the design of 3D COFs. Additionally, most 3D COFs are based on the dia net 4,9,140,141 and the pts net 143,144 and are completely interpenetrated, while only some 3D COFs are not interpenetrated. 142,145 The interpenetration leads to interpenetration isomerism, 162 a form of polymorphism that can render crystallization of the COF more difficult. Surprisingly, interpenetration is not only a problem of 3D COFs but might play a role in the crystallization of 2D COFs as well. Simulation of the growth of 2D COF particles have revealed interpenetrated nuclei in COFs (Fig. 30 left). 114 While interpenetration in 2D COFs was not observed yet, it was observed in a 2D hydrogen bonded framework (HOF) composed of twodimensional hexagonal layers with a hcb net, where these layers were then interpenetrated in two directions (Fig. 30 right). 163 This indicates that such interpenetration might be possible in COFs as well.
The design of nets is normally straightforward, but there are exceptions where competing interactions hinder the formation of the desired net. 164,165 This was initially demonstrated with the unexpected formation of a bex net instead of the desired tbo net, driven by p-p interactions. 23 In this case, a 2D framework was obtained instead of a 3D framework from nominally a tetraamine and a trialdehyde building block. The bex topology  was only formed because the pyrene building block simultaneously acted in a dual role -as a four connected and as a two connected node in the structure. In similar systems based on pyrene or tetraphenylethylene building blocks combined with trigonal building blocks multiple sub-stoichiometric structure were obtained. 22,[166][167][168] This shows that even in carefully designed systems, structural polymorphism or multiple competing phases are a possibility. Conformers of a structure cannot only lead to decreased crystallinity and increased disorder, but also to polymorphism based on the same or different nets, when multiple configurations of conformers can form different periodic structures. In surface COFs (sCOFs) the different conformers can be resolved by STM at the local scale. 169 By this method it was possible to show the existence and co-existence of three distinct polymorphs of a sCOF, based on a four-connected pyrene and a linear linker linked by imine groups. The polymorphs differ in the net of the corresponding sCOF, where two polymorphs were found featuring a square lattice and one with a kagome lattice. This results from the fact that the 601 and 1201 bite angles of the pyrene linker enable the formation of both a square and a kagome lattice without deformation of bonds (Fig. 31). The second differentiating criterium was the orientation of the imines. Two polymorphs in the square lattice could be differentiated based on whether the imines were oriented in a ''homodromous'' or ''heterodromous'' fashion, meaning that the imines were either rotated in the same direction or in different directions. These two arrangements lead to slightly different lattice parameters. Similar polymorphs can be imagined for bulk COFs based on the same or similar linkers. While the differences between the polymorphs based on the rotation of the imines might not be resolvable by PXRD or be disordered at room temperature, the kagome versus square lattice would be clearly differentiable by X-ray powder diffraction. Two linkers are prominently used for square lattice and kagome COFs that both possess the 1201 + 601 binding motif: pyrene and tetraphenylethylene. For both linkers both nets would be possible. Interestingly, COFs using the tetraphenylethylene building block crystallize in the kagome net, 158,[170][171][172] while the pyrene based COFs crystallize with a square net. 32,[173][174][175] The fact that not both polymorphs are observed for each material could be explained with the different stacking behaviour of these materials, which showed that linkers like tetraphenylethylene tend to stack with zero offset, 158 while the pyrene linkers lead to constant offset stacking. 176 Whereas the zero offset stacking might be possible for a square lattice of tetraphenylethylene, a constant offset stacking would be difficult to reconcile with a kagome lattice. The pyrene linker tends to stack with an offset along its long axis. As the constant offset stacking has to agree between all the linkers, only one pyrene in a triangle stacks in the favoured directions, while the two others would be forced in directions that are not optimal. These examples suggest that polymorphism in COFs might be influenced by the stacking as well.
Both kagome and square lattice could be shown in a tetraphenyl ethylene based COF, by using the side chains on a second linear linker to influence the net formation (Fig. 32). 177 By introducing bulky side chains onto the linker, the formation of the kagome lattice was suppressed and the square lattice was formed, since the triangular pores of the kagome lattice where too small for the side chains. Only when no alkyl side chain was used, the kagome structure formed. Additional control over the formation of a square lattice or a kagome lattice can be exerted by the introduction of intramolecular hydrogen bonding 178 or by the choice of the solvent. 179 While these examples show well-resolved cases of polymorphism, in other cases were the different polymorphs cannot be separated or crystallized independently, polymorphism might lead to a mixture or a decrease  in order if multiple crystal structures compete with each other and co-exist.
4.3.4. Reducing conformers in stacked COFs. 2D COFs are composed of individual sheets or layers of covalently connected building blocks. To obtain a layered structure mostly flat building blocks are used to facilitate stacking. The design of flat building blocks is straightforward as the aromatic systems used to obtain rigid linkers are also flat. 20,21 The layers of the COF are then stacked by weak interactions to form the three dimensional structure. Since the weak interactions are dominated by nondirectional van-der-Waals interactions and hydrophobic interactions they pose a challenge for obtaining a well ordered material. 3,128,129 Stacking often leads to an energy landscape with several minima within a small energy window, which causes stacking polymorphism in the best case and disorder in the worst (Fig. 33). 128 Reducing the number of or deepening the minima in the stacking landscape are therefore approaches to improve the crystallinity in COFs. To this end, other, more directional inter-layer forces such as hydrogen bonding 180 or well-designed dipole-dipole interactions have been employed to enhance the order of interlayer stacking. The design of weak interlayer interactions to improve the crystallization is much more challenging than the intralayer structure, as the exact stacking configuration is highly dependent on factors such as the shape of the building blocks. 128 A well-defined stacking sequence is not only of importance for improving the crystallinity, but also other properties of the COFs are influenced by it, most prominently porosity and (vertical) charge transfer. Also, the stability of COFs can be affected by the stacking interactions as solvents can lead to ordered structural changes such as transforming a COF from eclipsed stacking to staggered stacking, 181 or result in the complete loss of order, for example through exfoliation of the layers. 15 The purposeful introduction of stronger interlayer interactions increases the propensity of the COF to form ordered stacking polytypes 114 and can thereby also enhance its stability.
Investigation of the stacking in COFs is often limited by the information that can be extracted from the available powder X-ray diffraction data. As such, the most prominent stacking types that are identified from PXRD are the so-called eclipsed stacking, which is likely to be an approximate to the real stacking type only, 182 and the completely offset, staggered stacking, all others being rarely discerned. 3,128,[183][184][185] In addition to these simple descriptions of stacking, works on varied forms of stacking and their influence on structure and properties of COFs exist, 186 but here we will focus on the challenges of stacking for crystallinity in COFs. In order to reduce the disorder generated by stacking in COFs, the non-directional forces involved during stacking can be used and rationally altered to improve the stacking order and thereby the overall crystallinity of the COF. When considering the stacking landscape of only two isolated layers, often multiple minima within a small energy window are observed (Fig. 34). 128,183 Several design strategies have been developed to improve the stacking and thereby the crystallinity of 2D COFs. 186 One approach to reduce the number of minima in the stacking landscape is to introduce molecular docking sites, for example by using propeller shaped building blocks that result in only a  single minimum for the staking energy landscape, thereby leading to eclipsed stacking. 183 Several minima within in a small energy window in the stacking landscape can lead to disorder. So-called lock-in configurations can introduce interactions beyond next neighbours can lift this degeneracy and lead to improved stacking. The lock-in can be achieved by outof-plane features such as twisted of phenyl rings, methyl groups on a truxene, or bulky isopropyl sidechains that lead to slipstacking or in some cases staggered stacking. 30,128,176,187 These are strategies based on the shape and geometry of the building block that lead to self-complementary van-der-Waals interactions. Since the lock-in of the layers leads to steeper energetic minima in the stacking landscape, the structure of the COFs is more well-defined and thereby these COFs are more crystalline. 128 Alternatively, stronger interlayer interactions are introduced to improve the layer stacking.
The tuning of donor-acceptor interactions between layers can be used to improve the crystallinity by the introduction of electron deficient and electron rich building blocks, such as fluorinated and nonfluorinated compounds. 128,[188][189][190][191] Since many functionalized COFs possess dipole moments perpendicular to the stacking direction, these dipoles need to be carefully managed as parallel aligned dipoles lead to repulsion that can make the stacking more difficult, resulting in lower crystallinity. 192 The inherent dipole moment of the COF linkage can be the source of such an interaction. The dipole of the imine linkage can be reduced by the introduction of a methoxy group adjacent to the imine bond 192 or by designing the structure such that the imines can stack in an antiparallel fashion in adjacent layers. 128 Antiparallel dipoles can also be introduced by dipole bearing building blocks that stack in an alternating fashion, such as with a pyrene dione building block. 152  Even stronger layer interactions can be introduced based on hydrogen bonding, which is possible with amide functional groups that twist out of plane and lead to continuous hydrogen bonded chains since each amide is able to provide one hydrogen bond donor group and one hydrogen bond acceptor group, leading to high crystallinity in the resulting COF. 9,193 Less directional, but strong interlayer forces have been used in a viologen based COF that contains cationic pyridinium groups. 63 These ionic groups provide strong interlayer interactions, as the chloride counterions are sandwiched between the staggered layers, providing the structure with a strong interaction across the layers. In an achiral imine COF, the stacking was influenced by the use of a chiral monoamine during the synthesis of the COF (Fig. 35). The chiral molecule was able to induce chirality in the stacked COF by the arrangement of the layers and building blocks within the layer, even though the chiral molecule was completely removed after the synthesis. The approach was shown to produce a range of chiral frameworks which could be proven by circular dichroism.
All these strategies that are used to improve the stacking can be used to improve the crystallinity of 2D COFs, however, these interactions are difficult to introduce in a purposeful manner and therefore are difficult to design.

Conclusion and outlook
The multitude of examples shown in this review that have explored paths of COFs formation underline the importance and the desire of the COF community to improve the crystallinity and stability in COFs (Fig. 36). Three paths were differentiated that can lead to crystalline covalently connected materials: reversible bond formation, pre-orientation and reduction of conformers. Following the proposed design strategies enables even the synthesis of crystalline COFs based on completely irreversible reactions.
We expect these three major trends to continue to improve the crystallinity and stability in COFs further, opening the door to entirely new COF designs where crystallinity and stability are not at odds with each other.
Identifying new reversible reaction pathways continues to produce chemical reactions that are capable of forming crystalline and covalently linked materials. Desired new reactions are reversible under mild conditions to allow for a wide range of functional groups, but ideally these reactions need very specific conditions or catalysts for reversibility, so that the resulting COFs are stable under the conditions relevant for applications. We expect that reactions will be identified where stable and highly crystalline COFs with high functional group tolerance can be synthesized directly. Possible examples include reactions that require special catalysts such as alkene metathesis, where removal of the catalyst completely arrests the reaction.
The separation of crystallization and stabilization will benefit from developing reactions that are highly reversible, but are followed by reactions that lock the labile linkage in place in a facile manner. Ideally, it will be possible to obtain single crystals of a material that can then be locked into a highly ordered and at the same time extremely stable material. This field will benefit especially from the investigation of the mechanism of COF formation and the development of new COF linkage locking strategies. The latter may lead to a resurgence in popularity of linkage groups that have attracted less attention recently due to their lower stability, such as boronic ester COFs, if their bonds can be suitably stabilized.
The formation of COFs from irreversible reactions through the design of low-conformer frameworks and tailored reaction conditions is still only in its infancy. We expect this field to act as a nucleation site for a rich new COF chemistry, as it promises highly robust and functional materials that can be synthesized in a single step. As the mechanism of formation of these materials is only partially related to the traditional reversible way in which COFs are formed, new conceptual groundwork and mechanistic insights will be needed to establish a more generalized and unified framework for the growth of crystalline and stable COFs based on reversible and irreversible reactions alike.

Conflicts of interest
There are no conflicts to declare.