question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Smarter building when serving

See original GitHub issue
  • this is a feature request, not a bug report, so I’m not really going to follow this issue template

The feature request

  1. preact create typescript myproj
  2. cd myproj
  3. yarn serve

The yarn serve command fails, because there’s no build/ folder. Here’s a feature for convenience:

  • if build/ doesn’t exist when yarn serve is run, then run yarn build and then serve so no error occurs
  • if I change some files and run yarn serve, I think (I haven’t tested this) preact will serve the old files. preact should detect if the files have changed: if they have, build before serving

Regardless of whether the second part of this feature has already been implemented, the first part is still a minor feature that’s worth having.

Implementation choices

I can’t immediately recall libraries that do this, but I’m certain there are some major repositories that do this.

  • there’s a package on NPM that does this: https://www.npmjs.com/package/build-if-changed
  • we could use git (I think), but I’m not a fan of this idea because if an ignored file changes, we should trigger a rebuild
  • we could get hashes of every file and store a cache, and when build is triggered, recalculate hashes and see if they match: if they don’t, rebuild, else, use the old build (this is a pretty much reimplementing the first option)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
JoviDeCroockcommented, May 14, 2020

I think you’re on the wrong repository, You meant to post this on preact-cli I’ll transfer this issue for you.

0reactions
developitcommented, May 19, 2020

FWIW Webpack 5 actually includes disk-backed caching, which is basically what the original proposal hints at. We could try it here to see if it’s an improvement for build times.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intelligent Buildings - an overview | ScienceDirect Topics
Smart building is a type of building with reasonable investment, efficient energy management, and comfortable and convenient environment, designed by ...
Read more >
Smart Building Services
Serving People. Building Technology. SBS was built with the purpose of serving our clients and team members well. We are experts in Building...
Read more >
Smart Building Service & Maintenance - MacDonald-Miller
As your full-service building partner, MacDonald-Miller is here to provide a smarter approach to traditional HVAC service and maintenance.
Read more >
Smart Building Technologies: Examples and Opportunities
Smart building technology is growing in popularity with each passing day due to its effectiveness in serving a business with accuracy.
Read more >
7 Smart Building Technologies To Help You Better Manage ...
AI-enabled Service Automation software then predicts upcoming maintenance and even reviews and approves work orders with minimal human ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found