Comments (12)
Couple of things:
- I'm seeing a bug in the cache extension where it puts the version number on twice for some reason.
- This would have to be a new option, something like
renderingCacheVersion
so it only applies to what gets rendered SSR. This would be something that only the CSS plugin knows about (for now).
from steal.
Can someone respond? I notice that this cache key feature is still not working as expected.
from steal.
My guess is that the server-side version is not running the cache extension for some reason. Do you see the one with the cache key first or the one without?
from steal.
@matthewp I see the one without first.
Could it be something with my service (added here)?
const ssr = require('done-ssr-middleware')
const path = require('path')
module.exports = ssr({
config: path.join(__dirname, '/package.json!npm'),
main: 'site-template/index.stache!done-autorender',
envs: {
'server-production': {
renderingBaseURL: '/dist',
baseURL: 'public',
bundlesPath: 'dist/bundles'
},
'server-development': {
baseURL: 'client'
}
}
}, {
strategy: 'seo',
xhrCache: false,
timeout: 30000
})
from steal.
I think you need to add cacheVersion
to your server-production config. That's how it knows to append the version number.
steal/src/cache-bust/cache-bust.js
Line 10 in c9dd1eb
from steal.
@matthewp when I do that I get this error in the console:
error: ENOENT: no such file or directory, open 'public/dist/bundles/site-template/index.js?v=10&v=10' {"errno":-2,"code":500,"syscall":"open","path":"public/dist/bundles/site-template/index.js?v=10&v=10","statusCode":404,"url":"file:public/dist/bundles/site-template/index.js?v=10&v=10"}
The index.js file is there.
Here are the changes I made:
const ssr = require('done-ssr-middleware')
const path = require('path')
module.exports = ssr({
config: path.join(__dirname, '/package.json!npm'),
main: 'site-template/index.stache!done-autorender',
envs: {
'server-production': {
renderingBaseURL: '/dist',
baseURL: 'public',
bundlesPath: 'dist/bundles',
cacheVersion: process.env.HEROKU_RELEASE_VERSION || 10,
cacheKey: 'v'
},
'server-development': {
baseURL: 'client'
}
}
}, {
strategy: 'seo',
xhrCache: false,
timeout: 30000
})
Also not sure why its there twice index.js?v=10&v=10
You have any thoughts?
from steal.
Oh yeah, I guess that makes sense, you don't want to do it that way. This might be specific to CSS and not a general issue with the cache extension.
If you can, can you edit your node_modules/done-css/css.js file here: https://github.com/donejs/css/blob/30bf1b52a5c1bb7c1a1a96eadf8ddebceccda168/css.js#L65
And manually add the version just to see if that works?
link.setAttribute("href", css.href + '?v=123');
from steal.
@matthewp Yes, that worked. Unfortunately, I cannot deploy it with that.
from steal.
I'm looking into a possible fix.
from steal.
I think the duplicate number is just a product of the test helpers being used in the tests. Not sure it's a real bug, so going to proceed with #2.
from steal.
Moving this to done-css.
from steal.
Moved here: donejs/css#66
from steal.
Related Issues (20)
- Proposal: rollup-plugin-steal-resolve
- Proposal: rollup-plugin-steal-remove
- Using deprecated packages is a cap
- Cannot specify babel path in stealconfig
- Not possible to have two steal bundled apps on the same page HOT 2
- Bugs and fixes
- Trying to get in touch regarding a security issue
- [CVE-2022-37257]/prototype-pollution found in npm-convert.js
- [CVE-2022-37258]/Prototype pollution found in npm-convert.js
- [CVE-2022-37259]/ReDos found in babel.js
- [CVE-2022-37260]/ReDos found in main.js
- [CVE-2022-37261]/Prototype pollution found in npm-extension.js
- [CVE-2022-37262]/ReDos found in main.js
- [CVE-2022-37263]/ReDos found in babel.js
- [CVE-2022-37264]/ Prototype pollution found in main.js
- [CVE-2022-37265]/ Prototype pollution found in babel.js
- [CVE-2022-37266] Prototype pollution found in babel.js
- ENOENT 'stealconfig.js' on node/Windows when configMain is not specified
- CVE-2022-37259 steal Inefficient Regular Expression Complexity vulnerability via string variable HOT 1
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 steal.