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

Enable Import Injection for Enhanced Compatibility with Modern Bundlers #709

Open
wants to merge 2 commits into
base: developer
Choose a base branch
from

Conversation

pietrobondioli
Copy link

@pietrobondioli pietrobondioli commented Oct 30, 2023

Description:

This PR introduces a minor configuration tweak to Stencil setup by enabling experimentalImportInjection. This enhancement is primarily designed to address known integration issues with modern bundlers, including Vite, ensuring this component library's seamless performance across a wider range of projects.

Reasoning:

  1. Complementary PR: This change complements PR #486 "feat(build): add import injection to fix vite-based consumers" from ceifa. While ceifa's PR addressed similar concerns, this PR aims to further elaborate on the importance and relevance of the adjustment for broader compatibility.

  2. Modern Bundlers Compatibility: By introducing this change, this component library now boasts improved compatibility with a range of modern bundlers, namely:

    • Parcel
    • Vite
    • Snowpack
    • Rollup

    This ensures the components can be effortlessly integrated into projects regardless of their chosen bundling tool.

  3. Evolving Recommendations in the React Community: The React core team and the broader community have been exploring alternatives to Create React App (CRA). A notable example is a recent PR that mentioned Vite among other alternatives. Additionally, there's a growing body of articles, such as this one, which discuss the limitations of CRA. While Vite is a significant focus of this PR, it's just one of the many evolving tools in the landscape.

  4. Deprecation of Experimental Flag: The experimentalImportInjection flag will soon be deprecated in favor of enableImportInjection, as highlighted in Stencil's official documentation. The evolution of this feature from "experimental" to a more stable setting is further endorsed by a PR in the Stencil repository that originally introduced this functionality.

  5. Non-Breaking Enhancement: Importantly, this PR doesn't impose breaking changes. Instead, it augments compatibility with popular bundlers, ensuring components' versatility in diverse development environments.

By integrating this change, this component library remains adaptive, aligning with modern development trends and practices. I appreciate any feedback and hope we can incorporate this enhancement for the continued success and adaptability.

@pietrobondioli
Copy link
Author

Any updates?

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.

2 participants