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
added CDN settings to reaction #4316
Conversation
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 this in it's own file
server/startup/index.js
Outdated
@@ -26,6 +26,11 @@ SimpleSchema.defineValidationErrorTransform((error) => { | |||
export default function startup() { | |||
const startTime = Date.now(); | |||
|
|||
// for the user who wants to serve bundled js and css files from different URL |
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 this in it's own file so we aren't anything extra to this file
@zenweasel updated. |
server/startup/cdn.js
Outdated
* | ||
* @returns null | ||
*/ | ||
export default function CDN() { |
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.
Function naming should follow the conventions in the style guide. Specifically this should be a verb giving you some sense of what this function does and camel casing includes acronyms. e.g. setupCdn
. And it should include a JSDoc
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.
@Akarshit What's happening with this?
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.
The JSDoc still needs work
server/startup/cdn.js
Outdated
import { Meteor } from "meteor/meteor"; | ||
|
||
/** | ||
* Sets prefix for the user who wants to serve bundled js and css |
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.
This is not in the correct JSDoc format. Please look at the documentation for the correct format.
Also, javascript functions don't return null
by default they return undefined
which is not the same thing
@zenweasel @Akarshit need another review here and to pull in the updated .snyk file from |
@spencern I have merge |
@Akarshit I need to take another look. Will do it on Monday |
When I follow the testing instructions I get
|
Ok, figured out that problems (have to rerun
Note that I am copying and pasting your instructions from above verbatim. |
@zenweasel That's weird, because I just tested the instructions again and they work. |
Yes, here is the exactly line I am pasting;
And I get:
|
I am expecting to get:
|
@zenweasel This is the intended behaviour |
Got it. Could have been clearer in the test instructions. |
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.
Tested. Verified works
@Akarshit We have a conflict here now |
@zenweasel |
Resolves #4315
Impact: minor
Type: feature
Issue
After creating the production bundle from reaction, if the user wants to serve the bundled js and css files, there is no native way to do it.
Solution
Meteor provides a function to set the serving URL of the
js
andcss
files, so I am just passing the CDN's URL from setting file to Meteor.Testing
meteor build --directory "build dir"
cd "build dir"/bundle/programs/server
npm install
cd "build dir"/bundle
PORT=4000 ROOT_URL=http://localhost.com METEOR_SETTINGS="{ \"cdnPrefix\": \"cdnURL\" }" node main.js
js
andcss
files from the "cdnURL"