Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

initial pf-react-demo-app architecture #2

Merged
merged 2 commits into from
Jul 20, 2017

Conversation

priley86
Copy link
Member

@priley86 priley86 commented Jul 11, 2017

This PR creates initial PF React demo architecture referenced in #1

Read more about all of the tools used and setup in the README

Some outstanding things that I would love some help on here:

  • a full review of Redux & Redux Saga implementation is needed. I am new to these patterns and would like to create the most helpful guide for our consumers in this boiler. (Todo: add support for logout mechanism which invalidates user login in localStoage).
  • a full review on Typescript types used. I have used any in several places which are probably unnecessary
  • in order to support Patternfly LESS w/ this boiler, I have added node-less-chokidar (similar to node-sass-chokidar. There is currently a bug preventing us from being able to truly watch several LESS files and still enable a single App.less file to compile (so for now, only App.less is truly watched). It would be ideal to watch all LESS and still compile a single App.less (similar to this)
  • We will need to enhance React Bootstrap's NavDropdown to support Patternfly style navs w/ icons. We also need to review all Nav styles built by React Bootstrap in the masthead.
  • Ideally, we can add support for a SecondaryNav in the VerticalNav and fully implement this pattern in React (instead of Jquery). This code is incomplete.
  • Currently Prettier plugin has issues respecting tslint configuration. However, as long as prettier.singleQuote is enabled in your IDE, it should be fine to use Prettier and avoid tslint errors. I expect these issues to be cleared up soon for full Prettier support w/ tslint, but until I am excluding tslint-config-prettier.
  • add Typescript type definitions into the patternfly-react distributions (so that custom type definition is not needed here)
  • add tests for Redux reducers / stateless components, etc.

@priley86
Copy link
Member Author

Why Typescript instead of Flow/ES6? See further commentary in #1.

Copy link
Member

@ohadlevy ohadlevy left a comment

Choose a reason for hiding this comment

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

@priley86 thanks! - I had a quick look and it seems fine - only comment is about not adding the missing components to pf-react directly vs building them here (nav, empty state etc).

I'm in mixed feelings about saga personally - how was your experience using it here?

title: string;
}

export const EmptyState: React.StatelessComponent<Props> = props => {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be in patternfly-react repo instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

+1

Copy link
Member Author

Choose a reason for hiding this comment

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

Added #7

@priley86
Copy link
Member Author

@ohadlevy agree that we should add any new UI components directly to pf-react. Temporarily, this can be used as source of determining what we should add in pf-react, then we can remove them from here and import directly. The goal is for this repo to visually showcase our components in a real application scenario.

@priley86
Copy link
Member Author

can we merge this PR and iterate some more in future PRs?

@priley86
Copy link
Member Author

@ohadlevy I was just reading a good thread on Redux vs MobX on Twitter. This is a pretty hot topic these days...
https://twitter.com/priley86/status/885873394604027905

I'm a pretty big fan of the Redux/Redux Saga approach for complex state interactions. Having reducers/sagas which can be easily be tested/reproduced in our unit tests and debugged (with time travel 😸 ) is a huge win for us devs handling complex async state. I remember not too long ago using libraries like async.js to handle a chain of asynchronous interactions, but Saga breaks this down into generators (using yield/await,etc). A much better approach...

With that being said, I think Redux is likely overkill for most simple UI state which is 1:1 (or is not changing in real-time like a notification list). So the advice I would give is only writing reducers/actions/sagas etc. when you know the state model will be complex, otherwise we have libraries like MobX (simpler state manager), or just simple API classes/simple reducers/simple selectors.

WDYT?

@priley86 priley86 force-pushed the architecture branch 2 times, most recently from e872bd5 to 9947509 Compare July 20, 2017 18:48
@priley86
Copy link
Member Author

priley86 commented Jul 20, 2017

In an attempt to keep this demo app moving, I am going to merge this PR and reference these issues for future additions. There are also a number of outstanding issues in PF-React which are ready for us to tackle.

Here are the ones I've identified that are specific this demo app:
patternfly/patternfly-react#42
patternfly/patternfly-react#43
patternfly/patternfly-react#44

#6
#5
#4
#3
#7

@priley86 priley86 merged commit b0307ca into patternfly:master Jul 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants