-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
DocumentCard: Convert to CSS-in-JS #7584
DocumentCard: Convert to CSS-in-JS #7584
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits and some other stuff which I don't consider them blockers and that's why I approve the PR. Would be nice though to have them all addressed)))
P.S. Did you consider grouping all the components in subfolders? It will be a nightmare to navigate having 4 files for each component in just one folder. I think moving to a different folder also wipes some of the git history or at least makes it harder to look with tools like git blame in VSCode so you decide what to do in this case.
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCard.styles.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCard.styles.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCard.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCard.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.styles.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.styles.ts
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.styles.ts
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.types.ts
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActivity.styles.ts
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActivity.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardDetails.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardLocation.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardLogo.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardPreview.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardStatus.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardTitle.tsx
Outdated
Show resolved
Hide resolved
@aftab-hassan I am curious why so many files are changing just 1 or 3 bytes. Is there some sort of unpredictability here with size auditor, or webpack, or is there some EOF character that is sporadically emitting? |
@mikewheaton The DocumentCard went up 1K in minified size (which maybe could equate to a few hundred bytes gzipped). I'm curious why; was the javascript styling larger than the legacy styling? Or, was there some sort of extra logic added? @aditima @aftab-hassan We are all on the same page here already, but just another example of how important drilling into bundle size difference is. If you think in the viewpoint of the author (Mike), you'll be curious about why this was; what kind of info would be valuable? (we talked about diffing the code which could help, but really just glancing at per module breakdown (this module added X bytes, this one removed X bytes) would get you a quicker answer.) There's also a few other things that made it difficult to parse the numbers: Change: 1498... Is this bytes? is it minified or gzipped? Is this small, medium or large? I don't have good context to know the impact. Suggestion:
I don't think you need MB or beyond. :) Also print both minified and gzipped. Or, short term, change the column header to say "minified" just to be clear we're not taking into account gzip optimization. |
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActivity.styles.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActivity.styles.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActivity.styles.ts
Outdated
Show resolved
Hide resolved
@dzearing I'm not sure why the bundle size went up. There are a lot of new files, and the style objects are slightly larger than CSS, so it may be a case of a lot of small changes adding up. @Vitalius1 Thanks for all the feedback! I've made the requested changes, could you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the PR with some more comments which are not blockers at all and will leave on you to decide if you want to address them.
Great job and thank you for making the changes requested so far 👍
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCard.base.tsx
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCard.types.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.styles.ts
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.tsx
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardActions.types.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardLocation.base.tsx
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardLogo.base.tsx
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardPreview.styles.ts
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardPreview.styles.ts
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/DocumentCard/DocumentCardStatus.base.tsx
Show resolved
Hide resolved
@yiminwu, could you review this PR? |
+1 We spoke offline as well and are on the same page about drilling down by module. That would help the author to know which specific files brought about a change in
This is bytes minified. David suggested an alternate way of reporting, which we will roll out in the next LightRail PR.
We'll do gzipped as well. |
🎉 Handy links: |
Pull request checklist
$ npm run change
Description of changes
Updates DocumentCard (and all of its sub-components) to use MergeStyles.
Microsoft Reviewers: Open in CodeFlow