-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(builtins): load min versions if available #1741
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.
This can probably be cleaner if you write a helper function with the path of the original and minified one.
Something like this: getExisting(preferred, fallback)
bf2843f
to
bedbcfd
Compare
@DeMoorJasper I created a file |
bedbcfd
to
27b1897
Compare
src/packagers/JSConcatPackager.js
Outdated
fs | ||
.readFileSync(path.join(__dirname, '../builtins/helpers.js'), 'utf8') | ||
.trim() + '\n'; | ||
const prelude = getExisting(path.join(__dirname, '../builtins/prelude2')); |
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.
Sorry for being difficult, but I'd prefer this to be more explicit.
Use the full paths, because this overcomplicates it a little in my opinion
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.
Understood. I did it in a separate commit.
I'll squash after we get this into an approved state.
src/utils/getExisting.js
Outdated
* we use min.js and .js (with .js as the minified fallback). | ||
*/ | ||
module.exports = function(minified, source) { | ||
if(minified.split('.').length < 2 && source === undefined) { |
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.
Do you want me to remove 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.
Yeah sure seems obsolete now that you've written them explicitly
6e8d77d
to
ae66d69
Compare
done, this should be good to go. I also squashed it. |
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.
Awesome, thanks for the nice cleanup!
src/packagers/JSPackager.js
Outdated
.replace(/;$/, '') | ||
}; | ||
const prelude = getExisting( | ||
path.join(__dirname, '../builtins/prelude.min.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.
It appears you forgot a ,
here though
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.
thanks, done
ae66d69
to
db168d7
Compare
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.
For some reason a lot of travis tests are failing, I'll look into that before anyone can merge 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.
For some reason a lot of travis tests are failing, I'll look into that before anyone can merge this
helpers.js prelude2.js and prelude.js don't have min versions in git tree.
I think we should have a fallback these instead of blindly checking for the minified versions.
(For when someone wants to use master directly for testing in their package.json instead of using a release bundle)
Thoughts?