Skip to content
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(plugin-netlify-cms): use 'netlify-identity.js' instead of 'netlify-identity-widget.js' #22387

Conversation

erezrokah
Copy link
Contributor

@erezrokah erezrokah commented Mar 18, 2020

Fixes #22386

Netlify Identity Widget provides two build outputs:

  1. netlify-identity-widget.js which initializes the widget on DOMContentLoaded.
  2. netlify-identity.js which doesn't initialize the widget.

This PR switches from number 1 to number 2 to avoid duplicate initialization as the widget is already initialized here

@erezrokah erezrokah requested a review from a team as a code owner March 18, 2020 20:38
@erezrokah erezrokah changed the title fix(plugin-netlify-cms): use 'netlify-identity.js' instead of 'netlif… fix(plugin-netlify-cms): use 'netlify-identity.js' instead of 'netlify-identity.js' Mar 18, 2020
@erezrokah erezrokah changed the title fix(plugin-netlify-cms): use 'netlify-identity.js' instead of 'netlify-identity.js' fix(plugin-netlify-cms): use 'netlify-identity.js' instead of 'netlify-identity-widget.js' Mar 18, 2020
@pieh
Copy link
Contributor

pieh commented Mar 18, 2020

There are some other references to netlify-identity-widget ( https://github.com/gatsbyjs/gatsby/blob/561d33e2e491d3971cb2a404eec9705a5a493602/packages/gatsby-plugin-netlify-cms/src/gatsby-browser.js ). Do those need to be adjusted as well?

@erezrokah
Copy link
Contributor Author

erezrokah commented Mar 19, 2020

There are some other references to netlify-identity-widget ( https://github.com/gatsbyjs/gatsby/blob/561d33e2e491d3971cb2a404eec9705a5a493602/packages/gatsby-plugin-netlify-cms/src/gatsby-browser.js ). Do those need to be adjusted as well?

Good question, the import statements (and any other references to the package name) should remain the same as the package imported is named netlify-identity-widget.
The change tells WebPack to use a different build output from the same package.
Hopefully that makes things more clear.

@pieh
Copy link
Contributor

pieh commented Mar 19, 2020

Good question, the import statements (and any other references to the package name) should remain the same as the package imported is named netlify-identity-widget.
The change tells WebPack to use a different build output from the same package.
Hopefully that makes things more clear.

Oh, derp. The additional abstraction there threw for a loop ;) Yeah definitely see how it works now

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

This makes sense, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug (plugin-netlify-cms): Netlify identity iframe is created twice when using netlify cms plugin
2 participants