Replies: 7 comments
-
I think its because compiler also converts |
Beta Was this translation helpful? Give feedback.
-
Probably, but that doesn't really make it necessary everywhere else I think. |
Beta Was this translation helpful? Give feedback.
-
The shape type is not a filename. The shape type doesn't have to deal with what chars the FS can support, where the file is/ The way files are converted to shape and shape templates is an implementation details. Shape templates can come from many sources, and even the folder name (Parts, Editors, ...) might impact the shape type. Could have shape types been modeled using a filename in mind? The type's components might also contain Is it overengineered? NB: |
Beta Was this translation helpful? Give feedback.
-
Yeah, sometimes file names don't match the pattern of shape types (which I also find confusing) but the conversions . -> _ and - -> __ are consistent throughout and I don't see why they're necessary (I don't see a technical reason, nor why it would be nicer but it's one more thing to know about). This particular aspect seems to be a leftover. |
Beta Was this translation helpful? Give feedback.
-
I thought about dynamic property accessors Shapes are also used as root properties in placement json files but that's okay as in the code we don't use property accessors for them, only for their well known child properties But with the dynamic shape factory |
Beta Was this translation helpful? Give feedback.
-
Good point! Though we could just use underscores in file names too. |
Beta Was this translation helpful? Give feedback.
-
What I learned so far from shape system is that |
Beta Was this translation helpful? Give feedback.
-
If you have a shape type with an underscore ("_") then the corresponding template file will have a dot (".") there. Similarly, a double underscore in the shape type will translate into a dash ("-") in the file name. It recently occurred to me that I don't see why this conversion is necessary, apart from "it used to be like this in O1".
In O1 this kind of had a technical reason: Shape types were also used in Placement.info files in XML attributes. It seems to me that technically using dots there would still be legal but certainly weird.
I don't see any technical reason in OC though. Everywhere where shape types are used they're just strings so they can contain anything. File names are the lowest common denominator but the affected characters wouldn't cause any issue there either. Not using underscores in cshtml file names is probably a C# convention but why not use dots and dashes in the string shape types too then?
Beta Was this translation helpful? Give feedback.
All reactions