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(components): include side effects from src for rollup resolution #7774

Conversation

joshblack
Copy link
Contributor

Closes #7773

Adds in the relevant src files to the sideEffects array to correctly emit our document event listeners on boot.

Changelog

New

Changed

  • Update sideEffects in components/package.json to include source files so that rollup's node-resolve plugin correctly emits imports that have side effects

Removed

Testing / Reviewing

  • Checkout the PR
  • Build the components package locally (yarn gulp scripts:rollup is a nice shortcut in packages/components)
  • Check out scripts/components.js and verify that the following block of code appears at the end:
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', init);
  } else {
    // DOMContentLoaded has been fired already
    // Let consumer have chance to see if it wants automatic instantiation disabled, and then run automatic instantiation otherwise
    setTimeout(init, 0);
  }

@joshblack joshblack requested a review from a team as a code owner February 10, 2021 18:30
@netlify
Copy link

netlify bot commented Feb 10, 2021

Deploy preview for carbon-elements ready!

Built with commit 037516d

https://deploy-preview-7774--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Feb 10, 2021

Deploy preview for carbon-components-react ready!

Built with commit 037516d

https://deploy-preview-7774--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Feb 10, 2021

Deploy preview for carbon-elements ready!

Built with commit e65448f

https://deploy-preview-7774--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Feb 10, 2021

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit e65448f

https://deploy-preview-7774--carbon-components-react.netlify.app

Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ✅

Screen Shot 2021-02-10 at 11 21 31 AM

Copy link
Contributor

@dakahn dakahn left a comment

Choose a reason for hiding this comment

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

image

@kodiakhq kodiakhq bot merged commit be7f7da into carbon-design-system:master Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use components from CDN using vanilla JavaScript
3 participants