-
Notifications
You must be signed in to change notification settings - Fork 97
Refactor: clean up what many devs left untouched (improves DX) #2588
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
base: refactor/docs
Are you sure you want to change the base?
Refactor: clean up what many devs left untouched (improves DX) #2588
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small questions. Love the decreased bundle sizes!
README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in the README
look great, thanks for addressing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers :)
/** | ||
* @deprecated | ||
*/ | ||
export type ClientParams = RestAdapterParams & UserAgentParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is already labeled as deprecated, do you think this is safe to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, as these are used by the legacy client.
The whole legacy vs plain client situation should be adressed by us soon IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 <[email protected]> * Update lib/plain/checks.ts Co-authored-by: Lisa White <[email protected]> * refactor: simplify or remove @ts-expect-errors * chore: set createAssetApi to private again --------- Co-authored-by: Lisa White <[email protected]>
1e3d873
to
5363aca
Compare
While working on the docs, I ran into a bunch of structural annoyances I couldn’t ignore anymore. Quick list:
index.ts
files, 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/entities
and forced the files to use "one layer less" to import types. Also helps with DX.Then I made sure our
exported-types
are actually only used to export typesWe still have plenty of circular dependencies, lets see if more optimization reduces bundle-size further :)