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

Gzip test assets #154

Closed
Havunen opened this issue Oct 16, 2018 · 9 comments
Closed

Gzip test assets #154

Havunen opened this issue Oct 16, 2018 · 9 comments

Comments

@Havunen
Copy link

Havunen commented Oct 16, 2018

Hi

I was recently investigating iOS disconnect issue and found out that karma test files are not gzipped by default.

Then I started looking for solution and found this plugin

https://github.com/GreenGremlin/karma-gzip

Using that improved iOS a lot,
Total test time went down from 1m 57s to 1m 28s and Bundle size went down from 4MB -> 657kb

why this plugin does not do that out of box?

@johnjbarton
Copy link
Contributor

why this plugin does not do that out of box?

Because you did not send your PR yet?

@Havunen
Copy link
Author

Havunen commented Oct 17, 2018

I was more like wondering should we include this functionality into karma-sauce-launcher or is it out of scope of this plugin

@johnjbarton
Copy link
Contributor

Did you try https://www.npmjs.com/package/karma-gzip?

@Havunen
Copy link
Author

Havunen commented Oct 17, 2018

yes, that was the point of this issue. I think developers are not aware of this fact that when you use sauce-launcher you need to manually gzip the test assets.

@jdmarshall
Copy link
Contributor

jdmarshall commented Oct 22, 2018

I think Havunen asks a pretty good question.

It looks like this could be done as a PR against karma itself, rather than tacking it onto karma-sauce-launcher. It might be as simple as adding this around line 67 of lib/web-server.js:

var compression = require('compression');
handler.use(compression());

There's a way to do by passing a callback in through the config for beforeMiddleware, but is there a good reason not to include the compression middleware by default?

@GreenGremlin
Copy link

GreenGremlin commented Dec 6, 2018

The karma devs actually removed gzip support some time ago. They have also, pushed back on adding support. I was recently able to get them to accept a PR that will allow me to simplify the karma-gzip considerably in a future update.

@GreenGremlin
Copy link

This discussion prompted me to update karma-gzip for karma v3.1. I've also renamed the package to karma-gzip-preprocessor, which should make even easier to use.

@wswebcreation
Copy link
Collaborator

Closing this due to inactivity, feel free to re-open if this is still an issue

@jdmarshall
Copy link
Contributor

@GreenGremlin

They're pushing back on precomputed gzip assets. I don't see how adding the compression library adds some sort of undo complexity to the codebase.

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

No branches or pull requests

5 participants