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: tweak imports #441

Open
wants to merge 3 commits into
base: v3
Choose a base branch
from
Open

chore: tweak imports #441

wants to merge 3 commits into from

Conversation

jeetiss
Copy link
Collaborator

@jeetiss jeetiss commented Apr 24, 2024

remove destructuring assignment for react wildcard import because it prevents tree-shaking and removing makes code little bit smaller

@jeetiss jeetiss requested a review from molefrog April 24, 2024 07:04
@jeetiss jeetiss self-assigned this Apr 24, 2024
Copy link

stackblitz bot commented Apr 24, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cf9ba61) to head (5e194b5).

Additional details and impacted files
@@            Coverage Diff            @@
##                v3      #441   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            1         1           
=========================================
  Hits             1         1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

size-limit report 📦

Path Size
packages/wouter/esm/index.js 2.13 KB (-0.64% 🔽)
packages/wouter/esm/use-browser-location.js 622 B (-4.31% 🔽)
packages/wouter/esm/memory-location.js 798 B (-3.39% 🔽)
packages/wouter/esm/use-hash-location.js 709 B (-4.19% 🔽)
packages/wouter-preact/esm/index.js 2.02 KB (0%)
packages/wouter-preact/esm/use-browser-location.js 552 B (0%)
packages/wouter-preact/esm/use-hash-location.js 618 B (0%)
packages/wouter-preact/esm/memory-location.js 702 B (0%)

@jeetiss
Copy link
Collaborator Author

jeetiss commented Apr 24, 2024

I guess this should fix #435 as well

@molefrog
Copy link
Owner

Thank you. In #428 we added a hack to ensure that useInsertionEffect isn't imported directly. Now we use a dynamic expression, would tree shaking work anyway? Is there any way to test this?

@molefrog
Copy link
Owner

Thank you. In #428 we added a hack to ensure that useInsertionEffect isn't imported directly. Now we use a dynamic expression, would tree shaking work anyway? Is there any way to test this?

@jeetiss What are your thoughts on it?

@jeetiss
Copy link
Collaborator Author

jeetiss commented May 13, 2024

@molefrog yep, hack with useInsertionEffect is stoping tree-shaking
i think this can be tested with size-limit, we just have to remove react from ignore list

but tree-shakability testing makes no sense to me now

  • all applications use all imports from react usually
  • it is broken by useInsertionEffect^ and we can't fix it

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.

None yet

2 participants