-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-plugin-netlify-cms): dynamically import netlify-identity-widget #9565
fix(gatsby-plugin-netlify-cms): dynamically import netlify-identity-widget #9565
Conversation
Not sure about the circleci errors, seems like the registry went down? |
@alexandernanberg seems to be the case 😩 May need to re-run these in a few minutes, but don't worry about them failing for 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.
Looks good; left a comment!
const errorRoute = /error=access_denied&error_description=403/ | ||
const accessTokenRoute = /access_token=/ | ||
|
||
exports.onInitialClientRender = ( |
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.
Is this whole block anything we want to test for? I'd think adding some tests would be really valuable here, even if "just" unit tests!
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.
Yeah, that would be nice. Not sure how tho, since it's a dynamic import things become a bit more tricky. Are there any similar tests a can look at to get going?
@DSchau I've given this some more thought and AFAK there is no good way to unit test this – without changing the source 🤔 Do you have any ideas? |
@alexandernanberg it's probably OK, don't worry about it! One thing I missed the first time... shouldn't |
@DSchau Good catch, I've added it now! |
Remove changes to unrelated files
Anyone know why @gatsbyjs/docs got assigned to review this PR? Though I'm happy to help, I'm not the one you want for reviewing |
@shannonbux Sorry about that – I had a newer version of prettier installed locally that formatted some files automatically, but I removed them from this PR when I realized that |
@DSchau Is there anything else that you want me to fix or is this ready to get merged? Would be nice to shave off ~50kb of the bundlesize for the current site I'm working on 😄 |
@alexandernanberg I think this should reviewd by @erquhart - I don't have enough context on |
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.
netlify/netlify-identity-widget#157 is unlikely to go through any time soon - this is better than nothing for now. Thanks @alexandernanberg!
Wahoo, my bundle size will halve with this. Thanks guys. |
Closes #9209
Also had to add
plugin-syntax-dynamic-import
to thebabel-preset-gatsby-package
config