Skip to content
代码片段 群组 项目
该项目从 https://gitlab.com/gitlab-org/gitlab.git 镜像。 拉取镜像更新于
  1. 9月 12, 2022
  2. 2月 28, 2022
    • Lukas Eipert's avatar
      Fix incremental webpack mode without live_reload · c957cc53
      Lukas Eipert 创作于
      If `live_reload` is disabled, we accidentally kill the webpack dev
      server because `devServer.webSocketServer.clients` is undefined, because
      we are checking the wrong condition. This fixes the condition check.
      c957cc53
  3. 2月 09, 2022
    • Lukas Eipert's avatar
      Update to latest webpack-dev-server · 8b36cbcc
      Lukas Eipert 创作于
      This fixes a bunch of dependency audit problems. Luckily the new
      webpack-dev-server is compatible with webpack v4 and webpack v5.
      
      Updating this separately from the rest of webpack seems like a step in
      the right direction. So far there are no problems with the webpack dev
      server locally and HMR and all these things seem to work perfectly.
      8b36cbcc
  4. 1月 20, 2022
    • Lukas 'Eipi' Eipert's avatar
      Change hashing algorithm in webpack · 8d42ec95
      Lukas 'Eipi' Eipert 创作于
      Webpack internally defaults to md4 hashing because it is fast.
      Similarly some loaders (e.g. cache-loader) use md5. This is generally no
      problem because they are mainly used for file hashes and nothing
      cryptography related.
      
      Unfortunately FIPS enabled versions of node do not allow to use these
      hasing algorithms because they are considered broken by cryptographic
      standards. All of these cryptographic functions come from openssl. So if
      one uses md4 or md5 on a FIPS enabled system, the webpack process will
      error.
      
      Luckily we can just monkey-patch the createHash function in node in
      order to use another algorithm. Thanks to this comment:
      https://github.com/webpack/webpack/issues/13572#issuecomment-923736472
      
      See also: https://gitlab.com/gitlab-org/gitlab/-/issues/322883
      
      Changelog: changed
      8d42ec95
  5. 8月 27, 2021
  6. 8月 26, 2021
    • Mark Florian's avatar
      Add LRU-like behaviour to incremental compilation · 3a7a35fb
      Mark Florian 创作于
      This adds least-recently-used-cache-like behaviour to the incremental
      webpack compiler. The `DEV_SERVER_INCREMENTAL_TTL` environment variable
      now determines the number of days that page bundles are considered
      "recent", and should be eagerly compiled. This number represents the
      trade-off between lazy/eager compilation versus low/high memory
      consumption of the webpack development server. A higher number means
      fewer pages needing to be compiled on demand, at the cost of higher
      memory consumption. A lower number means lower memory consumption, at
      the cost of more pages being compiled on demand. A value of `0` means
      that all pages in your history, regardless of how long ago you visited
      them, are eagerly compiled.
      
      This also makes the compiler record a history of visited pages even when
      disabled, so that if and when it _is_ enabled, that history can still be
      used to inform the LRU cache.
      
      The history-recording function is explicitly disabled in the case that
      webpack is running in CI.
      
      Part of https://gitlab.com/gitlab-org/gitlab/-/issues/300412.
      3a7a35fb
  7. 7月 23, 2021
  8. 7月 22, 2021
  9. 5月 14, 2021
  10. 3月 25, 2021
  11. 3月 10, 2021
  12. 2月 01, 2021
    • Paul Slaughter's avatar
      Remove extends and use _ for private methods · 105a247c
      Paul Slaughter 创作于
      Extends is used to represent an "is-a" relationship.
      It doesn't make sense for IncrementalWebpackCompiler
      is a NoopCompiler. Just because they are the same
      interface does not mean they have to inherit eachother.
      105a247c
  13. 1月 29, 2021
    • Paul Slaughter's avatar
      Fix missing semicolon · 1981c43c
      Paul Slaughter 创作于
      1981c43c
    • Albert Salim's avatar
      Fix failure in qa-frontend-node:10 · c097f349
      Albert Salim 创作于
      c097f349
    • Lukas 'Eipi' Eipert's avatar
      Add incremental compiler to webpack dev server · 76f9be20
      Lukas 'Eipi' Eipert 创作于
      In order to have quicker compilations while developing we are adding an
      incremental compiler to webpack to render routes on demand.
      
      When the developer is working on the dev server and enables the
      incremental compiler with DEV_SERVER_INCREMENTAL=true, the new
      functionality is enabled.
      
      The biggest problem to solve here: How can we _know_ which entry point
      to render and which not? Our current webpack integration with rails
      requires the webpack manifest to have a list of all existing entry
      points. So our incremental compiler takes the following approach:
      
      Every compilation of webpack will run `generateEntries` which generates
      a list of all our entry points. In that function we are able to replace
      all page specific entrypoints and point them to an empty file,
      unless we explicitly want them to compile.
      
      In the webpack-dev-server itself we register a middleware which keeps
      track of all the page specific bundles requested. Whenever a page
      specific bundle is requested that hasn't been requested before, we add
      it to the list of bundles we want compiled.
      
      This approach allows us to dynamically change the entry points without a
      need to restart webpack alltogether _and_ it works with hot module
      reloading.
      
      Rather than pointing to a blank javascript we are pointing to one which
      renders an overlay to let the user know that webpack compiles the page
      for the first time.
      
      Additionally we keep a history of requested routes in `tmp/cache` in
      order to keep the list of compiled entry points between sessions. In a
      next iteration we can add a bit of logic and e.g. remove entry points
      the developer hasn't been visiting in a week.
      
      First results are really promising (on my machine):
       - Memory consumption when idling: 1600MB => 340MB
       - Max memory: ~2200MB => ~1000MB
       - Initial Compilation time: 58s => 15s
       - Recompile afer a file change: 13s => 3s
       - Visiting a new page that hasn't been visited before, it takes about
         four seconds to reload the page, seven seconds to completely load the
         page.
      
      Currently the technique still watches all of the source files, so
      changing an unrelated file will trigger a recompilation. This is however
      a minor caveat and the same behavior that we currently have, maybe we
      can optimize in the future.
      76f9be20
  14. 12月 24, 2020
  15. 12月 23, 2020
  16. 8月 24, 2020
  17. 5月 15, 2020
    • Paul Slaughter's avatar
      Fix eslint broken for Jest · aa9ac23e
      Paul Slaughter 创作于
      **What happened?**
      Previously we just checked the immediate parent
      to see if the module was being included from eslint.
      Now we recursively check all the parents.
      
      Also moves this eslint check to it's own config/helper
      aa9ac23e
  18. 12月 17, 2019
  19. 10月 22, 2019
  20. 10月 16, 2019
    • Kamil Trzciński's avatar
      Change IS_GITLAB_EE to FOSS_ONLY · c2508bda
      Kamil Trzciński 创作于
      This removes the usage of IS_GITLAB_EE
      and prefer to use FOSS_ONLY that has
      the following states:
      1. nil/empty string: use CE or EE depending on sources
      1. false: use CE or EE depending on sources
      2. true: use CE always
      c2508bda
  21. 10月 15, 2019
    • Kamil Trzciński's avatar
      Make IS_GITLAB_EE consistent · 49dda390
      Kamil Trzciński 创作于
      Currently:
      1. If `IS_GITLAB_EE=` is used, it fails to generate Webpack
         as it cannot be parsed as JSON,
      2. If `IS_GITLAB_EE=1` is used, it fails on GitLab CE,
      3. If `IS_GITLAB_EE=0` it does work correctly, and disables EE,
      4. If `IS_GITLAB_EE=1` is used on GitLab EE it effectively required
         to run on EE changes.
      
      This changes to:
      
      Make `IS_GITLAB_EE=` to donate the intent to disable or enable EE
      sources, instead of requiring it, and makes the check consitent
      in behaviour.
      49dda390
  22. 4月 05, 2019
  23. 3月 29, 2019
加载中