Refactor: structural code cleanups (potentially outdated with v12)#2588
Draft
axe312ger wants to merge 23 commits intorefactor/docsfrom
Draft
Refactor: structural code cleanups (potentially outdated with v12)#2588axe312ger wants to merge 23 commits intorefactor/docsfrom
axe312ger wants to merge 23 commits intorefactor/docsfrom
Conversation
whitelisab
reviewed
Apr 15, 2025
Contributor
whitelisab
left a comment
There was a problem hiding this comment.
Just a few small questions. Love the decreased bundle sizes!
Contributor
There was a problem hiding this comment.
The changes in the README look great, thanks for addressing this!
lib/index.ts
Outdated
| /** | ||
| * @deprecated | ||
| */ | ||
| export type ClientParams = RestAdapterParams & UserAgentParams |
Contributor
There was a problem hiding this comment.
I know this is already labeled as deprecated, do you think this is safe to remove?
Collaborator
Author
There was a problem hiding this comment.
No, as these are used by the legacy client.
The whole legacy vs plain client situation should be adressed by us soon IMHO
Collaborator
Author
There was a problem hiding this comment.
@whitelisab so i checked, this is a left over from ages ago and just confuses people. so lets get rid of it! The real config types for plain and legacy client are available for our users
…ucture and less cross dependencies
…he type for the client creation options
…ensure naming of variable matches naming of type
…to use it and make compatible with typedoc
…ighlight our examples on contentful.com, config options as table, some more cleanups
* docs: categorize navigation for better plain and legacy client destinction * refactor: move createClient in its own file and rename defaultProps to plainClientDefaultProps * docs: add descriptions to our entity status check functions * Update lib/create-client.ts Co-authored-by: Lisa White <lisa.white@contentful.com> * Update lib/plain/checks.ts Co-authored-by: Lisa White <lisa.white@contentful.com> * refactor: simplify or remove @ts-expect-errors * chore: set createAssetApi to private again --------- Co-authored-by: Lisa White <lisa.white@contentful.com>
1e3d873 to
5363aca
Compare
7c3ba01 to
e3a608c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on the docs, I ran into a bunch of structural annoyances I couldn’t ignore anymore. Quick list:
index.tsfiles, they made imports messier than they needed to be. We’ve got modern IDEs, direct imports are fine.ClientOptions), the old deprected one was confusing and outdated, so I removedConfigParams.Great side-effect, the bundles shrink with these changes:
Original size in current master:
I removed the index file in
lib/entitiesand forced the files to use "one layer less" to import types. Also helps with DX.Then I made sure our
exported-typesare actually only used to export typesWe still have plenty of circular dependencies, lets see if more optimization reduces bundle-size further :)