You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on the ejs templates for blitz generate (which has syntax like <div<%= name %></div>) is currently a nightmare because syntax TS can't parse it, prettier can't parse it, eslint can't parse it etc.
This means you have to actually run the generator each time you make a change to see it's correct or not. And you have to manually format your code.
I think we should consider just doing plain string replaces instead.
Look how difficult this is to read and write:
import create<%= ModelName %> from 'app/<%= modelNames %>/mutations/create<%= ModelName %>'
This is SO much easier to read and write:
import createModelName from 'app/modelNames/mutations/createModelName`
Other motivations:
We will be adding template ejection for users to customize. So this affects all blitz users, not just blitz contributors.
We can run tests directly against the templates
This is also nicer for the template file names: createModelName.ts -> createProduct.ts
I didn't realize this was a discussion rather than a ready-to-implement issue. I personally see very little downside here but lots of upside. Owning our own templating system increases flexibility, it means we own the full pipeline rather than being tied to an external system that can break out from under us, and the guaranteed cross-system compatibility is nice. The implementation is also a nice forcing function for centralizing the generator logic in the superclass since all of the generator code is functionally the same.
What do you want and why do you want it?.
Working on the ejs templates for
blitz generate
(which has syntax like<div<%= name %></div>
) is currently a nightmare because syntax TS can't parse it, prettier can't parse it, eslint can't parse it etc.This means you have to actually run the generator each time you make a change to see it's correct or not. And you have to manually format your code.
I think we should consider just doing plain string replaces instead.
Look how difficult this is to read and write:
This is SO much easier to read and write:
Other motivations:
createModelName.ts
->createProduct.ts
/cc @aem
The text was updated successfully, but these errors were encountered: