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

[ROADMAP] Webpack-CLI v4 Roadmap #717

Closed
25 of 29 tasks
evenstensberg opened this issue Dec 25, 2018 · 46 comments
Closed
25 of 29 tasks

[ROADMAP] Webpack-CLI v4 Roadmap #717

evenstensberg opened this issue Dec 25, 2018 · 46 comments

Comments

@evenstensberg
Copy link
Member

evenstensberg commented Dec 25, 2018

Summary

This is the roadmap to keep progress of webpack-cli v4 which is on the next branch of webpack.

TODO

Stable

  • Choose a lead developer ALWAYS TO READ

In order to avoid conflicts and misunderstandings what happened before, together we select a leading developer. This person makes the final decision, when a dispute arises. If a situation arises when the whole team believes that the lead developer is wrong, then one of the developers from @webpack/core-team is involved in the dispute, his/her/it decision is last and not subject to dispute.

  • CLI arguments from core feat: cli flags webpack#10515 + tests
  • Allow multiple types for arguments, i.e.
    webpack --stats (means stats: true),
    webpack --stats=verbose (means: stats: verbose),
  • Allow negative boolean args, i.e. webpack --no-stats (means: stats: false)
  • Allow multiple same arguments, i.e. webpack --entry=./src/one.js --entry=./src/two.js
  • To solve the points above, we may need to seach good CLI helper, like yargs-parser and etc. Update - we decided to go with commander.js
  • Verify webpack-dev-server + webpack-cli:
    • Tests for webpack serve
    • Relax dependencies, i.e. webpack-cli should works with webpack-dev-server@3 and webpack-dev-server@next
  • Compatibility with webpack@4 + tests (always)
  • Write Documentation, need clarify What we should write
  • Refactor https://github.com/webpack/webpack-cli/blob/next/packages/webpack-cli/lib/utils/cli-flags.js . We need to determine what arguments we are leaving, what we remove in favor CLI arguments from core, for example --sourcemap is not good candidate (https://github.com/webpack/webpack-cli/blob/next/packages/webpack-cli/lib/utils/cli-flags.js#L236), because --devtool used in webpack and most developers are used, but verbose is used in most of CLI tools and will be great to keep it for better DX (it is alias for --stats=verbose), not sure, it can be misleading, need dicussion
  • 0CJS: webpack-cli should be shipped with info and init commands out of box, need discussion about serve command
  • 0CJS: webpack-cli should works without the --config option + tests
  • Update all dependencies to latest and setup dependabot
  • Part of the code in JS, part in TypeScript, let's choose one
  • Default stats value should be taken from user configurations, if user doesn't provide stats options (or aliases like verbose/quiet)
  • Resolve stale PRs (close/rewrite/add to project webpack-cli@5 https://github.com/webpack/webpack-cli/projects/5)
  • Resolve stale Issues (close/rewrite/add to project webpack-cli@5 https://github.com/webpack/webpack-cli/projects/5)
  • Resolve all TODO in tests and fix smotetest for windows

Post-beta (non-blocking)

  • Try to avoid using unnecessary dependencies, we should try to keep CLI small and fast
  • Clean up code
  • More Smoketests and improving watch smoketest
  • webpack interactive
  • Allow other packages register own command and flags for CLI
  • Union generate-loader + generate-plugin + webpack-defaults, we need discussion how to better to do it
  • Simplify and reduce unnecessary architecture stratification, for example https://github.com/webpack/webpack-cli/blob/next/packages/logger/src/index.ts, we do not need packages consisting of three lines of code, Need to look at all the other packages.
  • Increase coverage
  • Setup webpack bot for github actions

Feel free to come up with feedback

@renatoagds
Copy link

renatoagds commented Dec 28, 2018

@evenstensberg cli-gui will be released with next or standalone?

@ematipico
Copy link
Contributor

ematipico commented Dec 28, 2018

The UI package will be released as a standalone package, probably we will release a minor version just to support the cli command

@daniele-orlando
Copy link

Nice roadmap of solid improvements.

@evenstensberg
Copy link
Member Author

evenstensberg commented Nov 6, 2019

Roadmap blocking a beta as per now:

  • Progress flag needs a rebrush
  • Adding interpret
  • Supporting mjs and pre-processing files
  • Adding verbose flags
  • Dev-server version bump

@evenstensberg
Copy link
Member Author

Removed webpack-config-plugins as it's not fit for webpack v5 yet. Also upgraded our peerDep + dep to webpack v5. After fixing failing tests and those regressions we are go.

@TheLarkInn
Copy link
Member

Let's add #1126 to blocking list.

@godcrampy
Copy link
Member

I'd like to write some smoke-tests! Can I get some pointers as to what kind of smoke tests are to be written besides the ones which are already present. What all stuff are these tests supposed to display?

@evenstensberg
Copy link
Member Author

Fixing the smoketests for watch mode would be really nice, right now those are kinda flaky, so we've disabled the CI to run them.

Could you check that out? The tests are supposed to show that the CLI is rigid and doesn't break under harsh conditions 👍

@endiliey
Copy link

Hi there, this is sort of unrelated but can I suggest to use "Squash and Merge pull request" instead of "Merge pull request" moving forward. Currently, its very hard to track changes between version of webpack-cli because a lot of commits in a PR is all retained. Here is an example:

v3.3.5...next

Due to using "merge pull request", there are lot of "extra" commits being sent here. Even something like "fix: revert :("
image

If squash merge was used, it will be something like below, which is more cleaner

An example is webpack/webpack-dev-server@v3.8.2...v3.9.0
Less number of commits, and related PR is linked
image

@evenstensberg
Copy link
Member Author

I think one of the reasons why we changed from squash to merge was because people wanted the entire commit log, but I'm happy to do squashing, it's cleaner, if there's no objections

@godcrampy
Copy link
Member

godcrampy commented Nov 22, 2019

I tried running the smoketests as is without any changes. Currently they return Test for child compilation hang, exiting. Is this delay a problem with core webpack or is the current smoketest causing it to behave this way.

Also, for the temporary files that are created during the smoketest, will it help if instead of appending comments we add some javascript snippets to check the watch mode performance.

@evenstensberg
Copy link
Member Author

Do you have a stack trace @godcrampy ?

@godcrampy
Copy link
Member

When I run $ npm run smoketest I get the following:

============================ RUNNING FOLDER: watch ============================
============================ ITERATION: 1/100  =====================================
Running: ./watch/watch.array.smoketest.js
Running: ./watch/watch.single.smoketest.js

============================ ARRAY/CHILD COMPILATION ============================

[
  {
    output: {
      filename: './prod.js',
      path: '/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/binary2'
    },
    target: 'node',
    entry: '/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/index.js',
    mode: 'production',
    devtool: 'eval-cheap-module-source-map',
    plugins: [ [DefinePlugin] ]
  },
  {
    output: {
      filename: './dev.js',
      path: '/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/binary'
    },
    target: 'node',
    entry: '/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/index.js',
    mode: 'development',
    plugins: [ [DefinePlugin] ]
  }
]

assert.js:92
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Test for child compilation hang, exiting
    at Timeout._onTimeout (/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/watch.array.smoketest.js:63:24)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: true,
  expected: false,
  operator: 'strictEqual'
}

============================ SINGLE COMPILATION ============================

{
  entry: '/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/index.js',
  target: 'web',
  output: {
    filename: 'bundle.js',
    path: '/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/bin'
  }
}

assert.js:92
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Test for child compilation hang, exiting
    at Timeout._onTimeout (/home/godcrampy/Code/Sandbox/node-sandbox/webpack-next/repos/webpack-cli/smoketests/watch/watch.single.smoketest.js:58:24)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: true,
  expected: false,
  operator: 'strictEqual'
}

The exact iteration it fails varies between 1 to 3 for my machine. The current error is shown when the webpack compiler exceeds 5 seconds for compiling the given changes on watch mode.I think that the arbitrary five second wait time to decide whether the process is stuck is a bad metric.

These exceptions come from here:
https://github.com/webpack/webpack-cli/blob/next/smoketests/watch/watch.single.smoketest.js#L56
https://github.com/webpack/webpack-cli/blob/next/smoketests/watch/watch.array.smoketest.js#L60

@ematipico
Copy link
Contributor

At the moment the output of the new CLI is not correct. It doesn't provide all the information.
It should provide the exact same information that the function stats.toString(options.stats) emits.

Also, the result of current output is misleading and incorrect. I will take a shoot at that if anyone won't.

@rishabh3112

This comment has been minimized.

@ematipico

This comment has been minimized.

@LunaticProgrammer

This comment has been minimized.

@parth-gr

This comment has been minimized.

@rishabh3112

This comment has been minimized.

@Parikshit-Hooda

This comment has been minimized.

@snitin315
Copy link
Member

snitin315 commented Jun 9, 2020

Regarding --stats, should we apply a general solution like --multiType-flag which will allow -

  • webpack --multiType-flag => multiType-flag: true
  • webpack --multiType-flag value => miltiTypeFlag: 'value'

Or we will be supporting multi types for stats only?

@alexander-akait
Copy link
Member

Why we need support multiple stats?

@snitin315
Copy link
Member

not multiple stats but multiple types for stats.

I'm thinking to add a property multiType : true for stats inside cli-flags.js ?
Any suggestions ?

@alexander-akait
Copy link
Member

@snitin315 I can't understand, please clarify

@snitin315
Copy link
Member

No worries I will create a Draft PR for same.

@snitin315
Copy link
Member

0CJS: webpack-cli should be shipped with info and init commands out of box, need discussion about serve command.

I think now cli supports info and init out of the box.

"@webpack-cli/info": "^1.0.1-alpha.4",
"@webpack-cli/init": "^1.0.1-alpha.5",

/cc @rishabh3112 am I right?

@rishabh3112
Copy link
Member

Yes, but serve is still left for integration as decided.

@alexander-akait
Copy link
Member

@rishabh3112 Let's send a commit with integration, we will fix an problems with options late

@rishabh3112
Copy link
Member

rishabh3112 commented Jul 29, 2020

@evilebottnawi Sure, I will send PR then.

@billyjanitsch
Copy link
Member

Hi, I just wanted to cross-link this comment #1222 (comment) because this might be the more appropriate issue:

Please, please reconsider having webpack-cli depend directly on @webpack-cli/init (#1609). The latter is an enormous module with so many dependencies (particularly jscodeshift, which is huge and very outdated). This doesn't affect bundle size, of course, but it does affect install time and npm's ability to dedupe modules. Plus, the init functionality is only useful when initializing a project, and most projects probably don't use it to initialize themselves anyway.

This issue came up back when webpack v4 was in beta. There's nothing wrong with @webpack-cli/init existing, but webpack-cli is currently required to invoke webpack via CLI and it would be really nice to have some way of doing this without bringing in half of the npm registry. All that most people need is to be able to add a simple build script to package.json. webpack-cli v3 did the right thing by including only this minimal core.

In an empty project, npm install webpack-cli@next (4.0.0-rc.0) currently installs 82mb of dependencies (!) whereas npm install webpack-cli@3 only installs 6mb.

@alexander-akait
Copy link
Member

@billyjanitsch yes, we will do it

@lopopolo
Copy link

lopopolo commented Oct 9, 2020

@evilebottnawi is there a ticket to track the removal of @webpack-cli/init as a required dependency of webpack-cli?

@alexander-akait
Copy link
Member

@lopopolo We search way to not remove it, but reduce size

@alexander-akait
Copy link
Member

webpack interactive

We have separate issue and PR for this

Allow other packages register own command and flags for CLI

Already supports, but not documented, we need do some improvements (I will do it in near future)

Union generate-loader + generate-plugin + webpack-defaults, we need discussion how to better to do it

We have separate issue for this

Todo for tests also have own issues

So let's close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

16 participants