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: export transformWithEsbuild #4882

Merged
merged 5 commits into from
Sep 18, 2021

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Sep 8, 2021

Description

Expose transformWithEsbuild from the vite package. Also fixes tsconfigRaw merging for transformWithEsbuild and perf improvements.

Additional context

  • transformWithEsbuild is currently already exposed under server, but I don't see it coupled to the server. It could be used as a standalone.
  • This also allows vite-plugin-svelte to use it for preprocessing a Svelte file script tag with lang="ts"
  • Do we want to deprecate server.transformWithEsbuild?

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.

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
@benmccann
Copy link
Collaborator

Should the "b" be capitalized? I.e. transformWithEsBuild?

@bluwy
Copy link
Member Author

bluwy commented Sep 9, 2021

I think transformWithEsbuild reads fine too as esbuild is usually all lower caps, but in code we capitalise the first e.

yyx990803
yyx990803 previously approved these changes Sep 10, 2021
Copy link
Member

@yyx990803 yyx990803 left a comment

Choose a reason for hiding this comment

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

Yes I think we can deprecate server.transformWithEsbuild with this.

@bluwy
Copy link
Member Author

bluwy commented Sep 10, 2021

Added deprecation jsdoc for server.transformWithEsbuild and removed docs for it.

Currently, the vue plugin is still using server.transformWithEsbuild. With the new API, it seems that it could benefit from a sizable refactor so I'm not touching it for now. It should still work as before.

const result = await options.devServer!.transformWithEsbuild(

@patak-dev patak-dev added this to the 2.6 milestone Sep 16, 2021
@patak-dev patak-dev merged commit c8c0f74 into vitejs:main Sep 18, 2021
@bluwy bluwy deleted the feat/export-transformwithesbuild branch September 18, 2021 16:31
patak-dev pushed a commit that referenced this pull request Sep 18, 2021
* feat: export transformWithEsbuild

* chore: add tests

* fix: test typo

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>

* chore: deprecate server.transformWithEsbuild

* docs: add transformWithEsbuild

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
ygj6 pushed a commit to ygj6/vite that referenced this pull request Sep 22, 2021
* feat: export transformWithEsbuild

* chore: add tests

* fix: test typo

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>

* chore: deprecate server.transformWithEsbuild

* docs: add transformWithEsbuild

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
aleclarson pushed a commit to aleclarson/vite that referenced this pull request Nov 8, 2021
* feat: export transformWithEsbuild

* chore: add tests

* fix: test typo

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>

* chore: deprecate server.transformWithEsbuild

* docs: add transformWithEsbuild

Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants