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 tsup bundling local package imported types #2663

Merged
merged 9 commits into from
Oct 2, 2023
Merged

Conversation

shahriar-shojib
Copy link
Collaborator

@shahriar-shojib shahriar-shojib commented Oct 2, 2023

Description

This PR aims to fix d.ts bundling of locally imported types

See changesets.

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2023

⚠️ No Changeset found

Latest commit: 663f789

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Oct 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 2, 2023 2:23pm

@zbeyens
Copy link
Member

zbeyens commented Oct 2, 2023

Lodash

Lodash size has been decreased, but is still included in the bundle with 35kb. Any idea? https://bundlephobia.com/package/@udecode/[email protected]
I've found https://www.npmjs.com/package/@optimize-lodash/esbuild-plugin and https://github.com/josteph/esbuild-plugin-lodash but not sure if there would be a diff

tsserver

image
Removing : PlatePlugin makes the diff. The additional type inference and compatibility checks at the assignment is where it gets slow.

✅ Type error (caption/deserializeMd)

What about trying to revert AnyObject change?
Doing so outputs:

TS4023: Exported variable  createHorizontalRulePlugin  has or is using name  AnyObject  from external module
"/Users/zbeyens/GitHub/plate/packages/core/dist/index"
but cannot be named.

@shahriar-shojib
Copy link
Collaborator Author

shahriar-shojib commented Oct 2, 2023

I will try reverting the AnyObject change as it should no longer cause an issue.
Right now I need help with tsconfig change that shows error on vscode because the package's tsconfig does not have the paths.
The tests pass because the test files are supposed to be using config/tsconfig.test.json
image

and the @jsx pragma can probably be omitted by setting jsx to react-jsx

@shahriar-shojib
Copy link
Collaborator Author

as for lodash bundling, I inspected the output and lodash is not bundled, instead it's being imported, I'll double check

@zbeyens
Copy link
Member

zbeyens commented Oct 2, 2023

I've found a fix for the type error. Plugin attributes should all be optional. These were the only 2 plugins with required attributes. Releasing the patch.

@zbeyens
Copy link
Member

zbeyens commented Oct 2, 2023

/tip $50

@algora-pbc
Copy link

algora-pbc bot commented Oct 2, 2023

👉 @zbeyens: Click here to proceed

@zbeyens zbeyens merged commit 1aae330 into main Oct 2, 2023
8 checks passed
@zbeyens zbeyens deleted the fix/dts-bundling-issue branch October 2, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants