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

Progress logs for templated pages #1859

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open

Conversation

phukon
Copy link
Contributor

@phukon phukon commented Apr 8, 2024

Description

#1852

Implement feature as a Vite plugin to count markdown files in the pages directory and compare them with the number of pages built during the Vite build process. This will provide the build progression percentage specifically for templated pages.

Copy link

changeset-bot bot commented Apr 8, 2024

⚠️ No Changeset found

Latest commit: d81f93f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 1:16pm

Copy link

netlify bot commented Apr 8, 2024

Deploy Preview for evidence-development-workspace ready!

Name Link
🔨 Latest commit d81f93f
🔍 Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/661ba694b40e8b0008df6621
😎 Deploy Preview https://deploy-preview-1859--evidence-development-workspace.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mcrascal
Copy link
Member

mcrascal commented Apr 8, 2024

Epic, thank you!

@phukon phukon marked this pull request as draft April 8, 2024 01:31
Copy link
Member

@archiewood archiewood left a comment

Choose a reason for hiding this comment

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

Sorely needed feature!

What's the current UX for using this plugin with npm run build

@phukon
Copy link
Contributor Author

phukon commented Apr 12, 2024

[wip]

Goal: Forked childprocess tracks the progess on each template file (route)
Used blessed for the terminal ui

After the modules are transformed, the childprocess's stdout is shown on the terminal, while the parent's stdout is redirected to log file in /tmp so that the logs from the parent doesn't ruin the UI. Happens at the very last stage of the build process.

Should I progress further or is it complicating a very trivial thing?

Code_BlC1iEwrAx.mp4

@phukon phukon changed the title Percentage complete progress logs for templated pages Progress logs for templated pages Apr 12, 2024
@phukon phukon requested a review from archiewood April 12, 2024 21:40
@archiewood
Copy link
Member

archiewood commented Apr 12, 2024

Should I progress further or is it complicating a very trivial thing?

My instinct is this is a lot of additional LoC and some more deps for a useful, but not essential feature.

Is there a simpler approach we can run using something like fs or chokidar - existing dep?

If it makes it easier, I'm not sure it's essential to know "percentage complete" vs just the number of pages built so far

Copy link

netlify bot commented Apr 13, 2024

Deploy Preview for next-docs-evidence ready!

Name Link
🔨 Latest commit d81f93f
🔍 Latest deploy log https://app.netlify.com/sites/next-docs-evidence/deploys/661ba6944d6e790008fc750e
😎 Deploy Preview https://deploy-preview-1859--next-docs-evidence.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@phukon phukon reopened this Apr 13, 2024
@phukon phukon force-pushed the next branch 2 times, most recently from 56e04e9 to e536983 Compare April 13, 2024 22:14
@phukon
Copy link
Contributor Author

phukon commented Apr 13, 2024

  • Routes for template pages are constructed.
  • A single chokidar watcher is set with depth calculated from the routes.
  • Rollup's buildEnd hook was ineffective, so a 60sec countdown is created to return control from the plugin to the caller so the build proceeds.
GmbZnTIRWf.mp4

@phukon phukon marked this pull request as ready for review April 13, 2024 22:44
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

3 participants