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

chore: update react output target #1055

Merged
merged 22 commits into from
Feb 7, 2023
Merged

Conversation

micahjones13
Copy link
Collaborator

@micahjones13 micahjones13 commented Jan 31, 2023

Brief Description

Updates our react wrapper to support tree-shakable components.

This allows for vite to work with out components, and also it looks like tree-shaking is working.
The following is how I tested vite and treeshaking:

  • Upgraded stencil output target, updated stencil configs to support treeshaking (see stencil.config.js)
  • Ran stencil build, react build
  • Symlinked astrouxds/react
  • Used symlinked package in a vite/react app. Worked fine.
  • In a CRA, I used the analyze tool to see the difference in bundle size. It was 237 KB total with just a rux-button, and then 250 KB when I added a RuxInput too. For comparison, our current astrouxds/react package is measuring around 2.1 MB.

JIRA Link

https://rocketcom.atlassian.net/browse/ASTRO-5369

Related Issue

General Notes

Motivation and Context

Provides tree-shaking for our react wrapper, upgrades the stencil-react-output-target, and allows for our react components to work in a vite/react app.

Issues and Limitations

Types of changes

  • Bug fix
  • New feature
  • Breaking change

Checklist

  • This PR adds or removes a Storybook story.
  • I have added tests to cover my changes.
  • Regressions are passing and/or failures are documented
  • Changes have been checked in evergreen browsers

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2023

🦋 Changeset detected

Latest commit: 49a6543

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Jan 31, 2023

Deploy Preview for astro-preview canceled.

Name Link
🔨 Latest commit 49a6543
🔍 Latest deploy log https://app.netlify.com/sites/astro-preview/deploys/63e274562d165f00087248e4

@netlify
Copy link

netlify bot commented Jan 31, 2023

Deploy Preview for astro-stencil canceled.

Name Link
🔨 Latest commit 49a6543
🔍 Latest deploy log https://app.netlify.com/sites/astro-stencil/deploys/63e2745602871b0008e6e24d

Copy link
Contributor

@markacianfrani markacianfrani left a comment

Choose a reason for hiding this comment

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

changeset and we good. somethin somethin vite support, tree shakeable build for react

@micahjones13 micahjones13 merged commit 3d0d7cd into main Feb 7, 2023
@micahjones13 micahjones13 deleted the mj-react-wrapper-update branch February 7, 2023 16:09
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.

4 participants