•  
      request #9948 Replace npm by Yarn
    Infos
    #9948
    Thomas Gerbet (tgerbet)
    2017-06-13 14:54
    2017-02-10 18:10
    10237
    Details
    Replace npm by Yarn
    Yarn has multiple advantages over npm:
    * determinism: no more random failure due to weird interactions between two installation runs
    * lockfile by default, everyone gets the same dependencies in the same version: no more sudden and unexpected dependencies conflicts because someone on earth decided to update his 10 lines package that everybody use
    * performance: faster than npm once the initial dependency graph is computed
    * nice cats drawings on their website

    The migration does not have to be a hard break, yarn is mostly interoperable with npm so people having just npm can still build the Tuleap sources they just would not profit of the yarn's feature (including the lockfiles so things might suddenly break on their side).
    Yarn is however easily to install, packages for major platforms are available and it can be installed through npm if really needed: https://yarnpkg.com/en/docs/install

    What we currently works:
    * developers use yarn to work on the Tuleap sources on a daily basis, it just works
    * unit tests pass with no specific issue since a long time: https://ci.tuleap.org/jenkins/job/gerrit_karma-yarn-tests/

    What's still needed to complete the migration:
    * gulpfiles must be updated to use either npm or yarn. They currently are hardcoded to use yarn
    * lockfiles must be committed with the Tuleap sources
    * yarn must be available during the Tuleap build process
    * Tuleap documentation should be updated
    Other
    All
    Empty
    • [ ] enhancement
    • [x] internal improvement
    Empty
    Stage
    Empty
    Declined
    2017-06-13
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2017-06-13 14:54
    The dedicated branch of the repository used to build the test Docker image has been removed.


    I declined this request.

    • Status changed from Under implementation to Declined
    • Close date set to 2017-06-13
    User avatar
    Thomas Gerbet (tgerbet)2017-06-07 15:09
    Ok so due to recent failures on our CI UT builds I have been forced to rebuild some of our Docker images. This rebuild has bring the update to npm5 with it and things seems to work out of the box.

    After a talk with @jmasson, we agreed on the following plan:
    * Yarn lockfiles will be removed
    * the change made to use Yarn if available (gerrit #7616) will be removed since we want to take advantages of the npm lockfiles
    * removal of the CI job running the tests with Yarn

    This request will get declined once these tasks are done and a new request will be created to follow the tasks needed to take advantages of the features of npm 5.
    User avatar
    Thomas Gerbet (tgerbet)2017-05-31 16:15
    Contributors with an appetite for front end development, do you have an opinion?
    User avatar
    Thomas Gerbet (tgerbet)2017-05-26 13:54
    Ok so NPM 5 [1] seems to be a game changer for this request. Most of the performance issues seems to be resolved and we got a proper lockfile to get reproducible build. Bonus point for being agnostic on the registry used to generate the lockfile [2].

    I'm not convinced anymore Yarn is the way to go with NPM catching up. @jmasson, do you have an opinion on this?


    [1] https://github.com/npm/npm/releases/tag/v5.0.0
    [2] https://twitter.com/maybekatz/status/862834964932435969
    User avatar
    Thomas Gerbet (tgerbet)2017-02-10 18:37
    A first contribution to use Yarn if possible to build the Tuleap components is under review: gerrit #7616.

    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes