Replies: 2 comments 1 reply
-
It seems like grid migration is more work than everything else combined 😄 i think the easiest would be to implement some new type of migrators, that would enable to create doctypes and datatypes. If the migrators encounter a type that can’t be handled, it should just throw an error, and then we should describe how to implement a custom migrator for the unhandled conversion. Setting up migration for the known types, “RTE”, “macro”, “embed” etc, could be done, but as you mention the implementation may only cover 80%. Doing them for LeBlender and DTGE should also be possible, but they should be as light as possible. |
Beta Was this translation helpful? Give feedback.
-
Yes - that is what i am leaning towards. the idea of nesting the migrators, so the grid migrator is basically parsing config/content and passing it on to 'Block/Grid' Migrators that can do things like create the doctypes, actually migrate the content. I am a little torn about how we 'create' the new content types - we want these migrators to be able to add properties to them and this might make a generic the separation of concerns between what the grid looks like and the properties inside it should in theory make the code simpler ! 🤞 . we already have some validation methods, so we too can probably do something that would at least throw warnings if we get something we can't automagically resolve, and say to people "you need to fix this" but yes the grid is often more work than anything else, it was the bulk of the translation stuff the first time around too :) |
Beta Was this translation helpful? Give feedback.
-
This is a bit of brain dump after a day of thinking and tinkering with grid to block (a lot of this was in my head and why i wasn't starting this one!).
@soreng has started a grid to block grid migration and its very cool - but it sort of scratches at the surface as to why migrating grid to block list is hard.
the problems are many but one that is a real pain is that we don't know the formats of the target elements in the grid, to create the blocks.
within grid config/content you just get an alias for a git element e.g.
or
There are plenty of ways we can guess this, (for example RTE is a Rich text editor) - but beyond the basics it becomes hard, what about leblender, or doctypegrid editors - they leak some information but not always enough.
the true configuration of a grid lives in the grid config files on the source site - this comes mainly from one file grid.editor.config.js in the config folder - except it doesn't exclusively come from there it can be a merging together of several files from packages and config.
So this would give us enough to say, we need to create a doctype with a text string in it called 'headline'
but uSync doesn't touch/have these files - so when we come to import we don't have all that.
So we can't reliably tell you what grid elements should be converted too. in terms of doctypes.
We have a few options
try and guess - which will work for 80% of people if they haven't done anything to fancy, with the grid, we can go, oh thats a RTE that's media etc. and we can with @soreng's PR go that's a DTGE - but what we can't reliably do is anything else.
validate - and pre-make content types. - We could as part of package validation go through the grid work out what the alias of content types should be and if they don't exist tell people they need to go create them?
again, we could do 80% of this create
BlockRTE
,BlockMedia
etc. and say you just have to do the rest now.?this might not work 100% because config might not contain all grid config, but if people uploaded it somewhere we could just go create all the grid elements from it.
NestedContent
toBlockList
in a current site as they go to v11.none of this is truly satisfying just yet- but i am thinking about it, ways in which we can make the migration less painful (it might be this cannot be pain free!)
Beta Was this translation helpful? Give feedback.
All reactions