-
Notifications
You must be signed in to change notification settings - Fork 257
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
Spike to convert the window top bar to the material framework; part of #1631 #1635
Conversation
673fb4e
to
c84829c
Compare
ce53904
to
a3af8b4
Compare
This bundle is pretty big. The Minimizing Bundle Size doc recommends two options for reducing bundle size as a temporary fix to tree shaking. Unfortunately, the ability to tree shake material-ui is still being worked out. However, it looks like this branch follows the Option 1 recommendation, so I'm wondering why material-ui is making the bundle so heavy? What does the |
Codecov Report
@@ Coverage Diff @@
## master #1635 +/- ##
==========================================
+ Coverage 86.29% 86.88% +0.58%
==========================================
Files 33 37 +4
Lines 321 343 +22
==========================================
+ Hits 277 298 +21
- Misses 44 45 +1
Continue to review full report at Codecov.
|
c87bc61
to
d13e32f
Compare
@sdellis thanks for looking into the bundling issues. It would be interesting to put heads together to talk about Material UI’s viability. withStyles returns an HOC with a
|
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.
I'm seeing the ThumbnailNavigation in here, but I imagine it was not part of this PR. At any rate, the thumbnails need to be keyboard accessible. Changing it to something like this will work:
<li
role="presentation"
className={ns(['thumbnail-nav-canvas', `thumbnail-nav-canvas-${canvas.index}`, this.currentCanvasClass(canvas.index)])}
>
<button
type="button"
key={canvas.index}
onClick={() => setCanvas(window.id, canvas.index)}
onKeyPress={() => setCanvas(window.id, canvas.index)}
>
{canvas.index}
</button>
</li>
However, the question is whether focus should go to the main content after a thumbnail is clicked (I think so). I'm concerned that a user navigating thumbs of a long book could want to get out of the thumbnails easily at any point, or they may want to focus on the content, but return to the thumbnail list with the thumbnail focus at the current index.
@camillevilla yes, let's tackle the bundle size in a separate ticket/branch. This PR looks good to me and none of my comments should necessarily stop it from merge I don't think. |
Do we know if |
@mejackreed we are somehow including the entirety of Material UI in this bundle, and it seems like there are ways to prevent this. We should be able to figure out the treeshaking or destructuring piece in another ticket/branch, so I see that as the way forward. I think it will be more difficult to back out of any such framework, but Material UI in documentation and theory seems to do the things we want. I'm approving this PR for merge and creating a separate ticket for treeshaking now. |
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.
👍 to merge. Unfortunately, theres's a merge conflict with a test that fails because of some configuration in master that is expected outside of the test. Perhaps that configuration should happen within the test, but it's not relevant to this PR other than it's blocking a merge.
I'll rebase it. |
d13e32f
to
328cfd0
Compare
Hey, material-ui contributor here. Just stumbled over this since this was referenced from one of my PRs and I wanted to investigate what issues you encountered with tree shaking.
@sdellis You don't actually have to use |
@eps1lon Our treemap only shows the mirador library because we are specifying |
I'm seeing this in our current build: https://gist.github.com/mejackreed/ae13d154ded8a836891acff3f776cc24#file-stats-json cc @eps1lon |
Thanks @mejackreed ... It's nice that webpack-bundle-analyzer can do this, and it demonstrates that all of Material-UI is being bundled, even though we are only using a handful of components and importing them as described in the Minimizing Bundle Size Docs. I switched to importing from the Any thoughts or advice on where to go from here @eps1lon ? |
https://deploy-preview-1635--mirador-dev.netlify.com/__tests__/integration/mirador/
🤷♂️
Part of #1631 #1633