Conversation
…ement IS stateless component
| import { ActivityItemPersonaExample } from './examples/ActivityItem.Persona.Example'; | ||
| import { ActivityItemCompactExample } from './examples/ActivityItem.Compact.Example'; | ||
| import { IDemoPageProps } from '../../demo/components/IDemoPageProps'; | ||
| import { DemoPage } from 'office-ui-fabric-react/lib/demo/components/DemoPage'; |
There was a problem hiding this comment.
office-ui-fabric-react/lib/demo [](start = 26, length = 31)
Did you mean to do a relative path import from here?
There was a problem hiding this comment.
Yes, I did actually mean to do relative.
| import { ComponentPage, ExampleCard, PropertiesTableSet, PageMarkdown } from '@uifabric/example-app-base'; | ||
| import * as React from 'react'; | ||
| import { ComponentStatus } from 'office-ui-fabric-react/lib/demo/ComponentStatus/ComponentStatus'; | ||
|
|
There was a problem hiding this comment.
auto-import keeps giving me non relative stuff
| donts: string; | ||
| bestPractices: string; | ||
| isHeaderVisible: boolean; | ||
| } No newline at end of file |
There was a problem hiding this comment.
2 things:
- we no longer call props pages ComponentProps.ts in Fabric. Instead, it is presently
.types.ts - need js doc here :)
There was a problem hiding this comment.
does it matter that this isn't going to be something we document with api documenter tool?
|
It would be helpful for code reviewers if you illustrated in your PR description the before/after so it is clearer how the circular dependency was before, so that reviewers can verify that the circular dependency is broken up now... |
|
I won't be able to break up the circular dependency until I'm done with part 3, so I can speak to just one file and its implications, @cliffkoh . Currently, we have a circular dependency of OUFR + Demo -> example-app-base -> OUFR What I seek to do is to move Demo pages out of OUFR (retaining the important examples, overview, etc in an exported JSON like I have here inside ActivityItemPage.tsx). So it'll look like this: Demo (consumes .md & page props inside OUFR via relative or webpack aliasing) -> example-app-base -> OUFR |
| @@ -0,0 +1,45 @@ | |||
| import { IComponentStatusProps } from 'office-ui-fabric-react/lib/demo/ComponentStatus/ComponentStatus.types'; | |||
There was a problem hiding this comment.
Should be a relative path import
| import * as React from 'react'; | ||
| import { ComponentStatus } from '../ComponentStatus/ComponentStatus'; | ||
|
|
||
| export const DemoPage = (componentPageProps: IDemoPageProps) => { |
There was a problem hiding this comment.
Please kindly type as React.StatelessComponent :) The current declaration isn't equivalent from a typing POV.
| /** title that goes into the header */ | ||
| title: string; | ||
|
|
||
| /** name of the component being documented */ |
There was a problem hiding this comment.
I know all these are not making it today, to the documentation page, but ultimately contributors to the OUFR library will be interacting with it when they fill out the IDemoPageProps object in each of the example page they craft.
So we really should have the same quality bar in our comments as we expect the directly public-facing documentation that makes it to the website.
You know.. broken window theory aside, I believe the core team needs to set a good example.
So Name of the component being documented. instead of name of the component being documented.
There was a problem hiding this comment.
I think we might want to write down the bar for documentation. I hadn't found a wiki page / readme on it so far. Perhaps I'll add it once I get this checked in.
* master: (274 commits) Demo Page Refactor Part 1 (microsoft#5055) SplitButton: Add aria-roledescription (microsoft#5062) Add addins sketch toolkit link (microsoft#5052) Dropdown title (microsoft#4983) Allow for more control over event handling for keytips (microsoft#5064) Build time speed improvements (microsoft#4965) Coachmark: Positioning fixes (microsoft#4995) Applying package updates. Experiments/Nav component: display "show more" link only if there is atleast one hidden link (microsoft#5057) Add pointerup listener to exit keytip mode (microsoft#5051) Update PULL_REQUEST_TEMPLATE.md Update ISSUE_TEMPLATE.md Shimmer: resolve conflicts (microsoft#5034) Invalid ARIA attributes: Fix empty values (microsoft#5040) ComboBox: Correct invalid ARIA attributes. (microsoft#4873) (microsoft#5001) ComboBox: Fix submit pending value (microsoft#5048) FocusTrapZone - restore last focused descendant element (microsoft#4897) Applying package updates. Take 2 of the require.resolve change. This time using the "resolve" pkg (microsoft#5031) fixing webpack config to allow rush build to complete on a small VM (microsoft#5037) ...
* master: (111 commits) Moving a variable to be defined sooner so that it is there when failures occur. Fix icon imports (microsoft#5069) MessageBar: More visible HC color for dismiss and expand buttons (microsoft#5061) Fix DetailsList accessibility and add more ARIA hooks (microsoft#5066) Update jest (microsoft#5068) Demo Page Refactor Part 1 (microsoft#5055) SplitButton: Add aria-roledescription (microsoft#5062) Add addins sketch toolkit link (microsoft#5052) Dropdown title (microsoft#4983) Allow for more control over event handling for keytips (microsoft#5064) Build time speed improvements (microsoft#4965) Coachmark: Positioning fixes (microsoft#4995) Applying package updates. Experiments/Nav component: display "show more" link only if there is atleast one hidden link (microsoft#5057) Add pointerup listener to exit keytip mode (microsoft#5051) Update PULL_REQUEST_TEMPLATE.md Update ISSUE_TEMPLATE.md Shimmer: resolve conflicts (microsoft#5034) Invalid ARIA attributes: Fix empty values (microsoft#5040) ComboBox: Correct invalid ARIA attributes. (microsoft#4873) (microsoft#5001) ...
Pull request checklist
$ npm run changeDescription of changes
This is Part 1 / 3 of a demo page refactor to get rid of circular deps in our fabric / demo / example-app-base. In this part, I'm simply trying to establish the pattern with ONE converted page to keep this checkin tiny and easy to review.
Part 2 will convert all other pages to use this format under fabric
Part 3 will actually remove the fabric -> example-app-base dependency
Focus areas to test
(optional)
Microsoft Reviewers: Open in CodeFlow