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

feat(ssr)!: remove dedupe and mode support for CJS #11101

Merged
merged 3 commits into from Nov 28, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Nov 28, 2022

Description

reverts #3951

Remove hookNodeResolve and the ssrRequireHook plugin so there isn't a chance for Vite's custom node resolver to interfere in cases we don't want to. Followup to #10593

Additional context

I've hit this issue again at withastro/astro#5459, it would be nice to remove this in Vite 4.

We don't have tests that cover this feature.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added p2-nice-to-have Not breaking anything but nice to have (priority) feat: ssr breaking change labels Nov 28, 2022
@benmccann benmccann linked an issue Nov 28, 2022 that may be closed by this pull request
7 tasks
@benmccann
Copy link
Collaborator

hurray! this would fix #10352, so I've linked that issue to the PR

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

And this is only for CJS. If there are folks that need this feature, we could also say that they can use Vite 3. I agree that this is a lot of added complexity for what we are getting at this point. cc @aleclarson, I think we should move forward and in the case, we found a real use case that can't stay in Vite 3, we can check what are our options (we can even revert this PR later, but at least we should try to move forward).

@patak-dev patak-dev merged commit 3090564 into main Nov 28, 2022
@patak-dev patak-dev deleted the remove-hook-node-resolve branch November 28, 2022 23:13
@bluwy bluwy mentioned this pull request Dec 7, 2022
7 tasks
futurGH pushed a commit to futurGH/vite that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change feat: ssr p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR resolve always happens as require even when it's an import
3 participants