Comments (13)
Correct. Would be the same process and tasks regardless of hash or filename addition
I've been doing this for my projects and preact-starter
, haven't run into any issues yet.
from preact-cli.
this would probably break the serviceworker setup since the html has to change in order to update the bundle url, right?
from preact-cli.
I'm not sure what you mean. The html would be different per build, and would be cached alongside the new build assets too. You'd be looking at fully immutable builds, from version to version.
from preact-cli.
Can't do immutable HTML since that's the entry point - its url has to be /
. The issue comes when you're on a page and the SW updates, and then have to reload to get the newest version. Maybe I'm thinking of this wrong?
from preact-cli.
Correct me if I'm wrong, but if you're not fingerprinting the assets, can't a user find themselves in a situation where their browser has evicted bundle.js from the cache, but not style.css, resulting in a newer version of bundle.js being styled with the previous version of style.css?
from preact-cli.
Sorry, "immutable" as in all assets. Only the index.html and sw.js filenames will be the same, but their contents always point to new files.
from preact-cli.
@dstaley right, that's what I'm trying to voice. When assets arent uniformly cached and versioned, you give yourself a window of being caught in between states.
from preact-cli.
html-webpack-plugin has a hash
option that appends the compilation hash to assets, which might work for this:
https://github.com/jantimon/html-webpack-plugin#configuration
from preact-cli.
What's the status of this? It would be great if there is an option in the cli to append hash on the bundle.
from preact-cli.
I think the hash-in-querystring approach is doable in the short term.
from preact-cli.
I have a fork that added hashing the bundle. I'll send a PR
from preact-cli.
@developit What's your hesitation to adding filename-hashes? I'm not sure, but I don't think that the querystring approach is compatible with even all the servers we offer ootb. Certainly more error-prone in userland with user-setup-servers... perhaps.
from preact-cli.
@lukeed It's true. I'm having a hard time fighting with nginx and querystring caching
from preact-cli.
Related Issues (20)
- compiling✖ ERROR Error: Babel-loader config not found!!! HOT 9
- Pages duplicate when accessing with /index.html HOT 9
- Brotli build - outputs content to same filename HOT 4
- default project template doesn't work with Node v18 HOT 4
- ERROR Error: error:0308010C:digital envelope routines::unsupported HOT 1
- Duplicated content when using /routes when using CLI v4 HOT 5
- Homepage content loaded on all non-prerendered pages HOT 3
- Add Typescript increasses the bundle size HOT 4
- Can't resolve 'preact-cli-entrypoint' HOT 4
- Exported rest param syntax functions create invalid build JS HOT 4
- preact-cli hangs after "✔ Done!" HOT 5
- CSS source maps missing in build output HOT 3
- Typescript v5.1.6 compatibility HOT 2
- Route code-splitting breaks lazy loading of images HOT 3
- Use esbuild instead of babel HOT 2
- Fail to build due to `property missing ':'` when inline style HOT 4
- "TypeError: Cannot read properties of undefined (reading 'call')" when trying to route split HOT 7
- OptimizeCssAssetsPlugin causes build to crash in Yarn PnP mode HOT 2
- Config file failure when adding plugins HOT 8
- build gets stuck at "after chunk asset optimization" HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preact-cli.