You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, to use stream field factories for non-trivial stream fields, a user needs to:
define each block as a class, avoiding the inline declaration syntax; and
create a block factory class for each distinct block class.
This means a typical Wagtail codebase may have tens of block factory classes that provide little other than boilerplate, and maybe some default values.
We should provide functionality for automatically generating the block factories, so that users of the library can avoid writing boilerplate for boilerplate's sake.
An ideal implementation would:
allow users to use stream field factories without declaring any block factory classes;
allow users to explicitly declare and use block factory classes, including them at the root of the tree (i.e. as the stream field factory entrypoint - matching current behaviour);
allow users to explicitly declare and use block factory classes, including them at arbitrary points in an otherwise automatically generated tree of block factories;
declare default values for block factories or their fields, at arbitrary points in the tree;
generate block factories lazily - only when they're required;
cache any generated block factories, so that effort isn't repeated;
continue to work with the existing syntax for specifying block values; and
include proper documentation.
The text was updated successfully, but these errors were encountered:
Currently, to use stream field factories for non-trivial stream fields, a user needs to:
This means a typical Wagtail codebase may have tens of block factory classes that provide little other than boilerplate, and maybe some default values.
We should provide functionality for automatically generating the block factories, so that users of the library can avoid writing boilerplate for boilerplate's sake.
An ideal implementation would:
The text was updated successfully, but these errors were encountered: