I'm working on migrating a legacy Sitecore site to JSS. In order to support the field types that they have in the existing site I have to support fields that do not conform to the predefined fieldTypes.
For example, I may get the following JSON for a component.
{
"componentName": "legacy-component",
"fields: {
"FirstName": "Test",
"LastName": "User",
"Profile": {
"Url": "http://example.com",
"Title": "Profile"
}
}
}
However, when simply copying this data via a route into the manifest the data gets converted to the following:
{
"componentName": "legacy-component",
"fields: {
"FirstName": {
value: "Test",
editable: "Test"
},
"LastName": {
value: "User",
editable: "User"
}
}
}
Notice that the value and editable fields are being injected (as expected), but the Profile field is being removed entirely. I've explored modifying the source and have some promising leads to be able to add the ability to essentially just pass through a json file for certain kinds of fields, while still supporting the conversion of common field types for the new component data that is added.
Ideally, I'm wondering if there's a way I can just pass through a copied json file to the manifest without it being modified in any way. The case this solves is FE developers working locally in disconnected mode without knowing anything about JSS or Sitecore, just the consumption of the data.