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

Remove plugin search feature #14759

Merged
merged 12 commits into from
May 5, 2023
Merged

Conversation

fisker
Copy link
Member

@fisker fisker commented Apr 25, 2023

Description

Closes #14652
Closes #8056
Closes #9167
Closes #13583
Closes #8474

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@kachkaev kachkaev added this to the 3.0 milestone Apr 26, 2023
@fisker fisker marked this pull request as ready for review April 27, 2023 09:18
@sosukesuzuki sosukesuzuki self-requested a review April 29, 2023 07:38
Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love changes like this that remove features as a maintainer, thank you. (One nits)

docs/plugins.md Outdated Show resolved Hide resolved
fisker and others added 2 commits May 4, 2023 17:20
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
@fisker
Copy link
Member Author

fisker commented May 4, 2023

@kachkaev

Reply to your question in discord about "global installation".

I don't have a good answer for that, they'll have to run or alias prettier --plugin=prettier-plugin-foo or prettier --config=/path/to/global/.prettierrc.

@kachkaev
Copy link
Member

kachkaev commented May 4, 2023

@fisker maybe there could be some solution offered on the editor extension level. I believe that a global Prettier setup with plugins is mainly needed in somewhat non-standard environments like in education. For example, prettier-plugin-elm is used with litvis for teaching data visualisation:

  1. Open a terminal window and install Prettier and Prettier Elm plugin with the following command:

    npm install --global prettier prettier-plugin-elm

In general, I am supportive of plugin search removal – this feature is really hard to implement for all package managers and various modes within them. We just need to be aware of us breaking certain valid use cases and be ready to offer a new solution for them. Perhaps, folks who do rely on global plugin search and can’t easily use import() in prettier.config.js can stick with v2 until a new solution is being sought. Once v3 is released, we’ll hear about more broken use cases which will help us finding something elegant. So let’s get this PR in! 🚀

@fisker fisker merged commit 54404fc into prettier:main May 5, 2023
@fisker fisker deleted the remove-plugin-search branch May 5, 2023 02:31
@vinkla
Copy link

vinkla commented May 5, 2023

Is there a possibility that this pull request could resolve the hoisting issue in pnpm?

pnpm/pnpm#4700

@dangmai
Copy link
Member

dangmai commented May 7, 2023

Hi,

I'm trying to understand the impact of this change for my plugin. Does this mean that I should ask all of my users to edit their Prettier config file to include something like:

{
  ... // rest of config
  "plugins": ["prettier-plugin-foo"]
}

or change their CLI call to include:

--plugin=prettier-plugin-foo

If that is the case, I can already foresee the amount of tickets opened in my project because of this 😭 .

I haven't followed upstream development closely recently, my assumption is that this will only be in Prettier v3 and above, not v2 right?

@fisker
Copy link
Member Author

fisker commented May 7, 2023

Correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants