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

Reworked Flow Development Guide #163

Merged
merged 33 commits into from
Aug 5, 2020
Merged

Reworked Flow Development Guide #163

merged 33 commits into from
Aug 5, 2020

Conversation

knolleary
Copy link
Member

@knolleary knolleary commented Jul 13, 2020

This PR represents the working copy of the Flow Development Guide. It is still being written - the PR is to share progress and get feedback.

This PR contains the changes from the following PRs:

The content from those PRs has provided the starting point for the guide. Not all of the content from those PRs will be in the final guide.

The working draft of the guide contains the sections:

The current version of this branch can be viewed here: https://new.nodered.org/docs/developing-flows/

knolleary and others added 27 commits January 31, 2019 10:42
* Pages to discuss chapter composition of flow dev guide

* Modified pages to discuss chapter composition
* Pages to discuss chapter composition of flow dev guide

* Modified pages to discuss chapter composition

* Renamed 'Practiec'->'Developing Flows'
@knolleary
Copy link
Member Author

I have removed the separate Handling Errors section of the guide as I realised we already have a section on how to do error handling in the main user guide.

Instead, I have added a smaller section to the Flow Structure guide that talks about how to layout the error handling and not about how to do error handling.

Copy link
Member

@dceejay dceejay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass.

@kazuhitoyokoi
Copy link
Member

#107 is part of the node development guideline. Therefore, it can be removed from this flow development guideline.

@knolleary
Copy link
Member Author

@kazuhitoyokoi you are right - #107 is not included in this PR. I listed it by mistake.

To make it easier to review this guide, I have set https://new.nodered.org - which is the flowdev branch.

The flow developer guide can be found here: https://new.nodered.org/docs/developing-flows/

@knolleary
Copy link
Member Author

Made some minor updates to reflect the comments from @dceejay - have updated https://new.nodered.org/docs/developing-flows/ with the latest

@knolleary
Copy link
Member Author

I have now added the Message section to the guide - https://new.nodered.org/docs/developing-flows/

This completes my first full pass through of the guide.

Question: is there any more content from the Hitatchi guide that should be added to the guide?

I would like to remove the extra Hitachi content before opening it for wider review with the community.

@kazuhitoyokoi
Copy link
Member

Thank you for your confirmation. I checked the website. This pull request contains all of the contents from Hitachi.

@knolleary
Copy link
Member Author

@kazuhitoyokoi I need to clarify what I plan to do as I'm not sure from your reply if it is clear.

Yes this PR contains all of the content from Hitachi. But the plan is to delete all of the pages from Hitachi because the information has been rewritten and included in the three sections I have been working on.

image

I want to make sure you are happy that the three sections I have written cover everything you think it should and that we are okay to delete the hitachi pages.

Copy link
Member

@dceejay dceejay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few extra bits

The messages that pass through a flow are plain JavaScript objects that can have
properties set on them.

They usually have a payload property - this is the default property that most nodes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to emphasise payload - eg like below - or maybe just bold

This section looks at some of the choices you need to make when deciding how to
stucture the messages in your flows.

### Working with the payload
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be msg.payload to link to the msg.topic heading below


This highlights an important principle: nodes should not modify or remove properties on messages that are not related to their functionality.

For example, in most cases, a Function node should send on the same message object it received rather than create a new message object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a Function node ? (Ok I get for most users yes... but...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Function node is the only node a user can explicitly create a new message object which is why it is singled out here.

As with programming in general, the choice of good property names is also important. They should be self-describing to help with later debugging and understanding of the flow. For example, `msg.temperature` is much more understandable than `msg.t`.


##
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supefluous

There is a balance to be considered here. The longer the label, the more space it needs in the flow. The shorter the label, the less information it can share.

For some nodes, it might be appropriate to hide the label altogether to minimise the horizontal space it uses in the flow - giving more room to other nodes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe an image of the "appearance tab" in config to show how to get to shorten the name


For example, the Switch node provides default labels for its outputs that are shown when the mouse hovers over them. They can help quickly identify the purpose of each branch in the flow.

Whilst the default labels may be sufficient in the context of the flow itself, it is also possible to custom labels to provide more detailed information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... also possible for custom ...


### Grouping nodes

A more explicit arrangement of the flows can be achieved by grouping related nodes together.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to grouping docs ? Or cut/paste blog post info to here ?

@dceejay
Copy link
Member

dceejay commented Jul 23, 2020

In intro para 3 - I think it is also worth adding a link to the YouTube introduction channel - as that is a good resource.
Do we want to add links to other parts of the docs - eg re context ? and or cookbook ?

@kazuhitoyokoi
Copy link
Member

@knolleary I misunderstood your question. Because today is a holiday in Japan, I will answer it on Monday after checking a little with Hitachi colleagues. Please wait a moment. 🙏

@knolleary
Copy link
Member Author

No rush - want to make sure we get this right.

I hope this plan does not come as a surprise - I have been saying since the start of reviewing the flow dev guide that I felt the best approach was to take the information from the Hitachi content and rework it into a slightly different shape.

@kazuhitoyokoi
Copy link
Member

@knolleary Thank you for waiting. Today, I talked about it with Hitachi colleagues. Because three sections contain key points, we agree with your decision. You can delete the Hitachi pages.

@knolleary
Copy link
Member Author

Thanks @kazuhitoyokoi

And please do remember, this is not a 'finished' guide - we can add extra content at any time. So if there are other topics you think it should cover in the future, then open an issue/pr and we can discuss.

@kazuhitoyokoi
Copy link
Member

@knolleary I appreciate your consideration. Okay, we will suggest a discussion if we have feedback from the Japanese community. 😁

@knolleary
Copy link
Member Author

I've updated flow dev guide to remove the extra pages. I'm going to share a link for the wider community to provide some feedback before we publish.

In terms of content, we still need to:

  1. create the images
  2. ensure consistent formatting when referencing nodes or message properties
  3. add links to related parts of the docs and videos

@knolleary knolleary marked this pull request as ready for review July 27, 2020 22:15
@knolleary
Copy link
Member Author

Going to merge this content as it currently stands.

I'm sure there's more to add, particularly around Performance, but I'd rather get this material published and available.

@knolleary knolleary merged commit d922100 into master Aug 5, 2020
@knolleary knolleary deleted the flowdev branch August 5, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants