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

Feature: Deprecate default exports from public entrypoints (or at least give every module named exports) #6079

Closed
etrepum opened this issue May 10, 2024 · 2 comments
Labels
enhancement Improvement over existing feature

Comments

@etrepum
Copy link
Contributor

etrepum commented May 10, 2024

The following modules use default exports in their entrypoints, which is inconsistent with the rest of the monorepo:

  • packages/lexical-react/src/LexicalClickableLinkPlugin.tsx
  • packages/lexical-react/src/LexicalErrorBoundary.tsx
  • packages/lexical-react/src/LexicalTableOfContents.tsx
  • packages/lexical-react/src/useLexicalEditable.ts
  • packages/lexical-react/src/useLexicalSubscription.ts

There are other reasons not to use default exports (e.g. the types are wrong in cjs, the module names are not always consistent with what we call them in OSS docs for www reasons, etc.) but I think inconsistency is a good enough reason.

I propose that we, at minimum:

  • Add named exports in all of these cases

Bonus points if we can agree to:

  • Mark default exports as @deprecated
  • Add a lint rule to warn when new default exports are added to public entrypoints (at least for packages/lexical-react/ where it has happened several times and has the most impact, everything else is a barrel file or not really API code like lexical-eslint)
@StyleT
Copy link
Contributor

StyleT commented May 21, 2024

@etrepum Hi! Can we close this?

@etrepum
Copy link
Contributor Author

etrepum commented May 21, 2024

@StyleT yes, it did not get closed because of a bug in the issue template that's fixed by #6124

@etrepum etrepum closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement over existing feature
Projects
None yet
Development

No branches or pull requests

2 participants