Skip to content
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

Add gzip for assets as well as server responses #983

Merged
merged 17 commits into from
Dec 14, 2019

Conversation

bdtomlin
Copy link
Contributor

@bdtomlin bdtomlin commented Dec 6, 2019

Purpose

Gzip Lucky::TextResponse if it's enabled #154

Description

@paulcsmith Lucky::TextResponse was definitely the right place to do this. The implementation was trivial. Once the static compression PR and this PR are merged, I will add a config file to the lucky_cli repo that enables this in new apps and contains comments that explain how it works.

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

This is so simple. I love it 👍 Just a couple suggestions

spec/lucky/text_response_spec.cr Outdated Show resolved Hide resolved
src/lucky/text_response.cr Outdated Show resolved Hide resolved
@bdtomlin bdtomlin changed the title add gzipping to Lucky::TextResponse A gzip for assets as well as server responses Dec 7, 2019
@bdtomlin bdtomlin changed the title A gzip for assets as well as server responses Add gzip for assets as well as server responses Dec 7, 2019
Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

A few small suggestions. Overall this is awesome. Can't wait to get this in people's hands! Thank you

spec/lucky/static_compression_handler_spec.cr Show resolved Hide resolved
spec/lucky/static_compression_handler_spec.cr Show resolved Hide resolved
spec/lucky/static_compression_handler_spec.cr Show resolved Hide resolved
spec/lucky/text_response_spec.cr Outdated Show resolved Hide resolved
spec/lucky/text_response_spec.cr Show resolved Hide resolved
src/lucky/server.cr Show resolved Hide resolved
src/lucky/static_compression_handler.cr Show resolved Hide resolved
src/lucky/static_compression_handler.cr Show resolved Hide resolved
src/lucky/static_compression_handler.cr Outdated Show resolved Hide resolved
@bdtomlin
Copy link
Contributor Author

@paulcsmith, all the issues have been resolved. I appreciate your patience as I learn crystal and lucky!

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

Just one tiny comment then LGTM! Nice work on this

spec/lucky/static_compression_handler_spec.cr Show resolved Hide resolved
@bdtomlin
Copy link
Contributor Author

There we go...

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

Perfect! 🎉

@paulcsmith paulcsmith merged commit a6bd331 into luckyframework:master Dec 14, 2019
djuber pushed a commit to djuber/lucky that referenced this pull request Aug 29, 2021
* added static asset compression to lucky apps

* settings for dynamic and static gzipping combined luckyframework#983

* added wrong branch name in dependency

* only compress static assets in production

* add new line to end of package.json

* Update src/browser_app_skeleton/webpack.mix.js

Capitalization fix

Co-Authored-By: Paul Smith <[email protected]>

* Update src/browser_app_skeleton/webpack.mix.js

Capitalization fix

Co-Authored-By: Paul Smith <[email protected]>

* Update src/web_app_skeleton/config/server.cr.ecr

Capitalization fix

Co-Authored-By: Paul Smith <[email protected]>

* Update src/web_app_skeleton/config/server.cr.ecr

Capitalization fix

Co-Authored-By: Paul Smith <[email protected]>

* fixed some whitespace issues

Co-authored-by: Paul Smith <[email protected]>
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.

2 participants