Skip to content

Remove checks for existing semicolons and newlines in concat_javascript_sources #310

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

Conversation

rmacklin
Copy link
Contributor

Closes #300

Unfortunately, given how widely used concat_javascript_sources is, this required changing a lot of tests. It would be nice if we could remove some of the duplication in these tests (so that similar changes would not require updating this many tests), but that can come in another PR.

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -90,16 +90,18 @@ def string_end_with_semicolon?(str)
end

# Internal: Accumulate asset source to buffer and append a trailing
# semicolon if necessary.
# semicolon and newline. This may result in duplicated semicolons and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to explain how it was before, so you can remove the section inside parentheses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed it in a81958c

@rafaelfranca
Copy link
Member

Thank you for the pull request.

@rmacklin
Copy link
Contributor Author

rmacklin commented Jun 13, 2016

It seems that the CHANGELOG no longer follows the form mentioned in the contributing guidelines, so I wasn't sure if there's a new process. Let me know and I'll update the CHANGELOG however is recommended.

@rafaelfranca
Copy link
Member

Add the new changelog entry above the last release

@rmacklin
Copy link
Contributor Author

OK, I updated the changelog in 0d27cc5

@rafaelfranca
Copy link
Member

Could you squash your commits?

…pt_sources

This may result in duplicated semicolons and newlines, but we don't mind
because they'll be removed by the minifier, and these checks were very
expensive.
@rmacklin rmacklin force-pushed the remove-checks-for-extra-semicolons-and-newlines branch from a81958c to 4715c16 Compare June 13, 2016 18:42
@rmacklin
Copy link
Contributor Author

I was just going to ask if you would like me to squash :)

Done.

@rafaelfranca
Copy link
Member

Thank you so much for the pull request. #311 had a different approach that I preferred since this code was added to make source maps indexing working and removing it may break source maps.

@rmacklin rmacklin deleted the remove-checks-for-extra-semicolons-and-newlines branch June 14, 2016 22:20
@rmacklin
Copy link
Contributor Author

rmacklin commented Jun 23, 2016

@rafaelfranca,

I just saw the discussion that has happened in #311 after it was merged. In particular the comments that:

drew my interest. So I was wondering: do you have any examples of broken source maps caused by this approach? I don't use source maps so it'd be nice to have something to start from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants