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(reporter): report built time #12100

Merged
merged 1 commit into from Feb 22, 2023
Merged

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Feb 18, 2023

Description

To show the total built time after the building completes.

image

Additional context


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 PR Title 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.

@btea
Copy link
Collaborator

btea commented Feb 18, 2023

There seems to be a plugin with similar functionality https://github.com/Shinigami92/vite-plugin-time-reporter.

faga295
faga295 previously approved these changes Feb 18, 2023
Copy link

@faga295 faga295 left a comment

Choose a reason for hiding this comment

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

LGTM~

@patak-dev
Copy link
Member

I personally would like to see this built-in. I think we should wait for Vite 5 to do changes to the output though. We can see what others think and then add it to the milestone.

@sun0day
Copy link
Member Author

sun0day commented Feb 18, 2023

I personally would like to see this built-in. I think we should wait for Vite 5 to do changes to the output though. We can see what others think and then add it to the milestone.

Sounds reasonable. I will open a discussion for that.

@patak-dev
Copy link
Member

We can use this PR to discuss 👍

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

I like this idea! I don't think we need to wait for Vite 5 though, it seems minor enough that it can fit the next minor (pun not intended).

packages/vite/src/node/plugins/reporter.ts Outdated Show resolved Hide resolved
packages/vite/src/node/plugins/reporter.ts Outdated Show resolved Hide resolved
packages/vite/src/node/plugins/reporter.ts Outdated Show resolved Hide resolved
@patak-dev
Copy link
Member

I'm fine having this in the next minor, we can add it during the beta and check that nobody complains. In part, I wanted to push it to 5 because we have been doing cli output changes on each major and wanted to start accumulating some diffs 👀

@sun0day
Copy link
Member Author

sun0day commented Feb 19, 2023

This PR just reports the total build time. Besides, there're 2 extra features we can discuss:

  • show build time of each bundle
  • expose build time metrics via vite.build(...) API

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 19, 2023
@bluwy bluwy added this to the 4.2 milestone Feb 19, 2023
@bluwy bluwy merged commit f2ad222 into vitejs:main Feb 22, 2023
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
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.

None yet

6 participants