Replies: 1 comment
-
|
This way it would also possible to create plugin that filter the output. Like in example when I only want to have react-query functions fo a subset of the API, there could be a plugin that removes all chunks witch did not start with X. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The code generator is a wonderful software, but over the last years I had some hard times using it. Last time today.
While thinking about it, I came to the conclusion that the fundamental problem is that the plugin model only allows a plugin to add a string to the output, but not to read or change what the others plugins do.
So let me give examples:
While thinking about this problems I came up with the idea to suggest the following change for the plugin structure.
Every plugin sees the same outputStream object witch works basically like an array with some usability helpers. The outputStream contains chunks which are basically have the metadata kind and name and optional other metadata too.
With this, each plugin that requires in example documentNodes could relay on the same base code which checks via exists function if an object with this kind and name already exists and did not append it again.
The end result after all plugins are done, would be this:
const output = outputStream.array.map(x=>x.content).join("\n");I did not know if this a good idea or not or if it makes sens at all, but at least I want to share my thoughts.
Beta Was this translation helpful? Give feedback.
All reactions