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

the latest patch release prevents jit-grunt from working #159

Open
travi opened this issue Jul 17, 2016 · 3 comments
Open

the latest patch release prevents jit-grunt from working #159

travi opened this issue Jul 17, 2016 · 3 comments

Comments

@travi
Copy link
Contributor

travi commented Jul 17, 2016

Things have seemed a bit off for a while, but I finally took the time to dig in and realized that jit-grunt was no longer being used, even though my working config had not changed in several of my projects.

My projects still load load-grunt-config as:

require('load-grunt-config')(grunt, {
        jitGrunt: {
            staticMappings: {
                cucumberjs: 'grunt-cucumber',
                ...
            }
        }
    });

With 0.19.2, my build output shows that all tasks are being loaded up-front:

Execution Time (2016-07-17 19:31:23 UTC)
loading tasks           1.9s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 12%
loading grunt-webpack  381ms  ▇▇▇ 2%
webpack:build          13.3s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 82%
babel:dist             524ms  ▇▇▇▇ 3%
Total 16.2s

If I downgrade to 0.19.1, jit-grunt appears to be used again, resulting in tasks loading more separately:

Execution Time (2016-07-17 19:37:07 UTC)
loading tasks           1.4s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 11%
loading grunt-webpack  221ms  ▇▇▇ 2%
webpack:build          10.3s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 82%
babel:dist             567ms  ▇▇▇▇▇▇ 5%
Total 12.5s

The important part of this issue is that some of my tasks depend on grunt-env to configure environment variables before tasks are executed. When all tasks are loaded up-front, some of them end up causing build failures because of premature parsing and execution.

@travi
Copy link
Contributor Author

travi commented Jul 17, 2016

looking into this a bit further, even downgrading to the previous patch does not seem to get jit-grunt to properly defer task loading. i'm not sure at this point when this became broken, so i'm not sure where to continue to investigate.

please let me know what other information from me would be helpful.

@SolomoN-ua
Copy link
Collaborator

Hi @travi,
can you provide webpack:build and babel:dist tasks configuration?
Also can you disable jit-grunt and provide execution time with load-grunt-tasks option?

@travi
Copy link
Contributor Author

travi commented Jul 19, 2016

here is the timing of the run w/o jitGrunt enabled:

Execution Time (2016-07-19 01:57:55 UTC)
loading tasks   2.9s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 17%
webpack:build  13.5s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 79%
babel:dist     723ms  ▇▇▇▇▇▇ 4%
Total 17.1s

i should have thought to include these links originally, but at least a few of the projects where i see the issue are public. https://github.com/travi/travi.org-admin is the specific one that i'm referring to above and is probably the simplest.

for the time being, i am forcefully setting the environment used in the webpack config because of the fact that it is undefined when the config is loaded by the grunt config.

you can see this by adding a console.log(process.env.NODE_ENV) in the config and running grunt build. you'll also notice that the undefined is printed almost immediately; long before the message showing that grunt-env runs to set $NODE_ENV to production.

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

2 participants