Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Review the templates to take advantage of the new features of Stencil 0.7 #231

Closed
AliSoftware opened this issue Dec 7, 2016 · 4 comments

Comments

@AliSoftware
Copy link
Collaborator

I think a lot of new features brought by Stencil 0.7+ could allow us to simplify our templates a lot, and get rid of some context variables that were introduced by GenumKit in the Context just because some constructs were not possible to be created in Stencil before, but now they are…

Examples include:

  • in the StoryboardContext, there's a isBaseViewController value which indicate if the baseType is 'viewController' or anything else. Now that we can use == in templates, that's probably obsolete
  • same for the Strings template. GenumKit exposes a context variable typednames which is an array containing typed declarations like "let p0: String","let p1: Int". Had to add that because there was no easy way to construct that directly in the template from the other variables. But now that GenumKit has the MapNode, we should be able to construct those from the types and names context
  • Same for declarations which contains let p0, let p1, etc… that we can probably construct from the names with is an array of p0, p1 and a MapNode
  • Even the names variable in the String context might now maybe be constructible in the template itself using a MapNode and the forloop.index or something
@djbe
Copy link
Member

djbe commented Feb 19, 2017

We could do another review-pass, but I think most of these have been covered in the 4.2 release?

@AliSoftware
Copy link
Collaborator Author

Idk i think everything has been covered but better double check, e.g.

  • did we properly get rid of our own join filter in templates and use Stencil's proper join filter, which is the same but with parameters and different default separator? (In other words did we specify the separator explicitly so that when we remove our own join filter it will continue to work)
  • did we prepare everything to get rid of old tags and filters in StencilSwiftKit which were implemented when Stencil didn't support filters with parameters yet, so that we're ready in 5.0 to migrate them to cleaner implementations using parameters instead of having multiple similar filters without parameters?

@djbe
Copy link
Member

djbe commented Feb 19, 2017

Item 1 is in SwiftGen/templates#22.
Item 2 still needs to be done, you opened a separate issue for it: SwiftGen/StencilSwiftKit#6

@AliSoftware
Copy link
Collaborator Author

Right. Then this should be OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants