# Enhancement proposal: more developer control over organization of Node implementations

**URL:** <https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109>\
**Category:** Feature Requests\
**Created:** [11 May 2018 19:45 UTC](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109 "2018-05-11T19:45:40Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![boneskull](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boneskull/32/71_2.png) [@boneskull](https://discourse.nodered.org/u/boneskull)\
**Post date:** [21 May 2018 18:41 UTC](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109/21 "2018-05-21T18:41:07Z")

</div>

@drmibell Agree; in no way should we make it _more_ difficult. Whatever we do should be backwards-compatible. To be clear, **in no way am I suggesting that we impose a different workflow upon Node developers**. I’m proposing we open the door to different workflows, and we do that by supporting optional configuration properties.

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mike/32/10_2.png) [@mike](https://discourse.nodered.org/u/mike)\
**Post date:** [22 May 2018 04:19 UTC](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109/22 "2018-05-22T04:19:32Z")

</div>

Yes. In addition to backward compatibility, I think a key point is we would like to make it easier to organise node front end code & templates in separate files, and include additional files like libraries and css, without the _need_ to introduce new tools. That’s the reason for paths in the `package.json` file in @knolleary sketch. That said, if you want to use new tools, like a compiler/transpiler and bundler, for example to use newer versions of JS or improve performance, you should be welcome to. Just point the paths to the bundles.

---

<div class="post-metadata">

**Author:** ![boneskull](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boneskull/32/71_2.png) [@boneskull](https://discourse.nodered.org/u/boneskull)\
**Post date:** [25 May 2018 20:41 UTC](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109/23 "2018-05-25T20:41:51Z")

</div>

I think that’s what I’m suggesting…

---

<div class="post-metadata">

**Author:** ![boneskull](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boneskull/32/71_2.png) [@boneskull](https://discourse.nodered.org/u/boneskull)\
**Post date:** [25 May 2018 20:46 UTC](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109/24 "2018-05-25T20:46:59Z")

</div>

Another point I’d like to raise, as it’s relevant to the discussion: it’s not so easy to share code between Nodes.

On the backend, you’re welcome to subclass Nodes (though this is not documented anywhere), but on the frontend, how can we keep it DRY?

Essentially, the frontend is just providing a configuration object (containing some functions), and some markup. How can we share the config object (in whole or in part)? How can we share the templates?

(Since _all_ templates are present in the editor’s DOM, we should be able to reference them, anyway…)

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mike/32/10_2.png) [@mike](https://discourse.nodered.org/u/mike)\
**Post date:** [25 May 2018 23:54 UTC](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109/25 "2018-05-25T23:54:26Z")

</div>

Somewhat related…

In a recent project I needed to get the ‘schema’ of a Node, that is, its properties and defaults, as well as the icon and how the label was generated. I used this to create a flow programmatically with my own UI, and display nodes and their status myself. I didn’t need to display the configuration dialogs, so the `onEditPrepare` and other methods for dialogs were not needed from what I recall.

To do this, I had to ‘borrow’ some interesting code from the flow library that executes front end code located in an html `<script>` tag in a sandbox that supplied stubs for front end `registerType`, `node`, and `$` functions. It works, sort of, but struck me as something we might want to make easier for API clients to do.

[Previous page](https://discourse.nodered.org/t/enhancement-proposal-more-developer-control-over-organization-of-node-implementations/109.md?page=1)
