Changes #33
Replies: 2 comments 3 replies
-
Some very good points here, and I agree with the changes you suggest! 😄 When it comest to supporting browser specific tags, there I am a bit unsure about what to do. However, I think it makes sense to support all the official and only add I also like And lastly, the combined protocol is more flexible, so if all the different sub-protocols makes sense to have separate as well, then I see that as the preferred design. |
Beta Was this translation helpful? Give feedback.
-
Also one ting on the It is a bit more code to get working, so is it worth it? E.g something like this: public enum MediaType {
public struct Common: StringRepresentable {
let mediaType: String
init(stringLiteral: String) {
self.mediaType = stringLiteral
}
public static let html: MediaType.Common = "text/html"
public static let css: MediaType.Common = "text/css"
}
} |
Beta Was this translation helpful? Give feedback.
-
Structure
I have resorted the files. For example:
The External-Folder contains all the HTML specifications, we try to mirror.
The Internal-Folder contains everything, wich makes HTMLKit work in the background.
The Attributes-File contains the official attributes.
@MatsMoll: Not sure if we want support browser-specific attributes?
The Elements-File contains the official tags.
@MatsMoll: Not sure if we want to support unofficial or deprecated tags too? Is it possible to mark some tags deprecated as the consortium decide to not support them anymore in the future?
The Functions-File contains the custom functions, the people use
The Types-File collects every type. Mostly used by the type-Attribute. I have tried to use enum as a namespace, when a type contains more then one category. For Example:
The Types-Files should not contain internal types!
Everything in the Internal-Folder should be bundled up in my opinion. I think it is not necessary to create files for every element, tag or attribute. It would increase the package size and I am not sure, if we have a goal here to stay slim.
Renaming
I have renamed a bunch of items to stick to the official terms.
ContentNode became NormalElement.
@MatsMoll We could use the term "ContentElement", if you think it fits better.
DatableNode became EmptyElement.
Since NormalElement renders
<tag></tag>
. EmptyElement renders<tag />
. There could possibly be a third element for<tag>
. But honestly I haven't done much research on it.HTML became HTMLContent
Aliases
The
<form>
element for example would have a lot of protocols, so I tried to follow the example ofand combine the attribute protocols. For example:
Instead of combining multiple functions in one protocol like we did in the past:
@MatsMoll Not sure here if my way is the best way.
Well for now, I think I got all changes. I am open for discussion as always.
I am offline for one week now. So take your time. :-)
Beta Was this translation helpful? Give feedback.
All reactions