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

review-issue-1228: speed up javascript task #1229

Closed
wants to merge 3 commits into from
Closed

Conversation

oliverfoster
Copy link
Member

@oliverfoster oliverfoster commented Sep 6, 2016

#1228

  • made all libraries in src/core/libraries load before adapt.min.js
    • they load on an http request each rather than being compiled (old school style) - seems like a reasonable trade-off now that network speeds are pretty good
  • removed unnecessary code references
  • removed build license comments in favour of dropping output compression (roughly the same byte size but reduces the compile time by 4 seconds)
  • allowed all plugins to have a "libraries" folder
  • added grunt build --newer
    • no clean
    • rebuild javascript only when source has changed

javascript:dev takes 2.2seconds - down from 3
javascript:compile takes 5 seconds - down from 14

@aniketdharia
Copy link
Member

👍 .. will test tomorrow and comment

@aniketdharia
Copy link
Member

Can we add a watch which will check if any JS is updated if not do not rebuild or copy these JS files?

@taylortom
Copy link
Member

@aniketdharia this is just a fix for the javascript compilation, we still have a watch at the end of the dev task.

@oliverfoster
Copy link
Member Author

@aniketdharia i can only do that by removing the clean task on build, otherwise you've nothing to compare the srcfiles to because the clean task deletes the contents of the build folder

@oliverfoster
Copy link
Member Author

oliverfoster commented Sep 7, 2016

to explain a bit, this pr is three ideas in one and is not intended to be merged, they are:

  • move all libraries out of the compile process
  • turn off unnecessary parts of the requirejs uglify2 process
  • add a way of doing a dest-src comparative rebuild (could also be done on a dev-style task instead of the build task)

they'll have to be separate prs if we agree these things are a boon to productivity

@aniketdharia
Copy link
Member

+1 from me.. personally as it is improving the speed even of grunt dev if we make similar changes... the option of avoiding unnecessary javascript and less compilation reduces the build time drastically... as once the theme and components are fixed for a curriculum, the only updates that would happen are in JSON files. Basically publishing tasks.

@oliverfoster oliverfoster changed the title issue-1228: speed up javascript task review-issue-1228: speed up javascript task Sep 8, 2016
@oliverfoster
Copy link
Member Author

need to split into separate prs

@oliverfoster oliverfoster deleted the issue-1228 branch September 22, 2016 11:10
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