-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Associate version to entry files #1060
Conversation
@@ -7,6 +7,11 @@ const APP_DIR = path.resolve(__dirname, './'); | |||
// output dir | |||
const BUILD_DIR = path.resolve(__dirname, './dist'); | |||
|
|||
const fs = require('fs'); | |||
const contents = fs.readFileSync('package.json'); | |||
const JSONObject = JSON.parse(contents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow this part did not re-run when js file/package.json is changed, not sure when exactly does webpack reload its config.js file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's only expected to run when an npm run (...)
command is executed
b50208a
to
a043a34
Compare
@@ -19,7 +24,7 @@ const config = { | |||
}, | |||
output: { | |||
path: BUILD_DIR, | |||
filename: '[name].entry.js', | |||
filename: '[name].' + VERSION_STRING + '.entry.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional nit, equivalent to :
`[name].${VERSION_STRING}.entry.js`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, nice es6 syntax.
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals
A few minor nits, but otherwise LGTM. Oh and please fix the Code Climate issue! |
@@ -7,6 +7,11 @@ const APP_DIR = path.resolve(__dirname, './'); | |||
// output dir | |||
const BUILD_DIR = path.resolve(__dirname, './dist'); | |||
|
|||
const fs = require('fs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's put all our require statements at the top of the file
should package.json version be the same as caravel version? using this method we would need to remember to update the package.json version with any js change. this would invalidate the cache on ALL of the js files and not just on the files that changed. not quite what we want to do here. essentially, we want the filename to update if the file changed, and to stay the same if the contents did not change. we should do this for the css files as well as the js files. i don't think we should need to pull the version from python. we should be able to achieve this using webpack and hashes. here's a good article on how to do this using webpack: https://medium.com/@okonetchnikov/long-term-caching-of-static-assets-with-webpack-1ecb139adb95 |
ef493e8
to
8f883b5
Compare
8f883b5
to
76b9bc5
Compare
LGTM |
nice work! 👍 |
* Associate version to entry files * Modified path joins for configs * Made changes based on comments
* Associate version to entry files * Modified path joins for configs * Made changes based on comments
…1205) * create structure for new forked explore view (#1099) * create structure for new forked explore view * update component name * add bootstrap data pattern * remove console.log * Associate version to entry files (#1060) * Associate version to entry files * Modified path joins for configs * Made changes based on comments * Created store and reducers (#1108) * Created store and reducers * Added spec * Modifications based on comments * Explore control panel components: Chart control, Time filter, SQL, GroupBy and Filters * Modifications based on comments
* Explore control panel - Chart control, TimeFilter, GroupBy, Filters (#1205) * create structure for new forked explore view (#1099) * create structure for new forked explore view * update component name * add bootstrap data pattern * remove console.log * Associate version to entry files (#1060) * Associate version to entry files * Modified path joins for configs * Made changes based on comments * Created store and reducers (#1108) * Created store and reducers * Added spec * Modifications based on comments * Explore control panel components: Chart control, Time filter, SQL, GroupBy and Filters * Modifications based on comments * accommodate old and new explore urls * move bootstrap data up in scope * fix code climate issues * fix long lines * fix syntax error
…pache#1205) * create structure for new forked explore view (apache#1099) * create structure for new forked explore view * update component name * add bootstrap data pattern * remove console.log * Associate version to entry files (apache#1060) * Associate version to entry files * Modified path joins for configs * Made changes based on comments * Created store and reducers (apache#1108) * Created store and reducers * Added spec * Modifications based on comments * Explore control panel components: Chart control, Time filter, SQL, GroupBy and Filters * Modifications based on comments
* Explore control panel - Chart control, TimeFilter, GroupBy, Filters (#1205) * create structure for new forked explore view (#1099) * create structure for new forked explore view * update component name * add bootstrap data pattern * remove console.log * Associate version to entry files (#1060) * Associate version to entry files * Modified path joins for configs * Made changes based on comments * Created store and reducers (#1108) * Created store and reducers * Added spec * Modifications based on comments * Explore control panel components: Chart control, Time filter, SQL, GroupBy and Filters * Modifications based on comments * Added access check + Druid in endpoint * pull grains to constants * Switch explore.html to old version
…pache#1205) * create structure for new forked explore view (apache#1099) * create structure for new forked explore view * update component name * add bootstrap data pattern * remove console.log * Associate version to entry files (apache#1060) * Associate version to entry files * Modified path joins for configs * Made changes based on comments * Created store and reducers (apache#1108) * Created store and reducers * Added spec * Modifications based on comments * Explore control panel components: Chart control, Time filter, SQL, GroupBy and Filters * Modifications based on comments
Not sure if I did the right steps for testing:
@mistercrunch @ascott @bkyryliuk