Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

support webpack 5.x #297

Closed
wants to merge 39 commits into from
Closed

Conversation

githoniel
Copy link
Contributor

@githoniel githoniel commented May 10, 2021

this PR will make webpack-chain work with webpack5 #266

I have checked the documentation for all supported options.

  • Class: use CreateClass(superClass) to support chained class inherited
  • Configuration: support almost all options in webpack5 and remove undocumented options.
    • partial support Module Contexts options. since they are document as deprecated and will soon be removed, so only parameters that the demo is provided in the documentation are supported
    • add new type ChainedValueMap to support object/boolean type for node/performance option as Support Config.node false value #252 suggested, API like config.node(false).
    • add tests for new config
  • Type declaration: use the type definition that comes with webpack itself
  • CI: change to use Github Actions
  • Doc: readme has updated

renovate-bot and others added 12 commits March 26, 2021 12:48
- add Callable Class
- rename `name` to avoid conflict with Function readonly property
- allow Config.node(false)
- Other Options
- Experiments
- Stats
- Node
- Performance
- Externals
- Watch and WatchOptions
- Target
- Devtool
- DevServer
- Plugins
- Optimization
- ResolveLoader
rename config.name to config.configName
@githoniel
Copy link
Contributor Author

@edmorley I have no idea how to deal with Travis CI, any idea?

@edmorley
Copy link
Member

@githoniel Thank you for the PR!

I have no idea how to deal with Travis CI, any idea?

Unfortunately there are no more Travis CI credits, so this repo needs to be migrated to eg GitHub actions:
#266 (comment)

Such a migration is a blocker for merging any other PRs.

@githoniel githoniel marked this pull request as draft May 10, 2021 13:13
@githoniel githoniel force-pushed the renovate/webpack-5.x branch 2 times, most recently from 2cf690d to 8abbf6a Compare May 11, 2021 15:13
@githoniel githoniel force-pushed the renovate/webpack-5.x branch 2 times, most recently from 7e0182e to 82a8ab5 Compare May 12, 2021 02:52
@githoniel
Copy link
Contributor Author

@0x1af2aec8f957
It should be assetModuleFilename not assetModuleFilenamet ?

@0x1af2aec8f957
Copy link

@0x1af2aec8f957
It should be assetModuleFilename not assetModuleFilenamet ?

yes

Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you for your work on this, and sorry for the delay in taking a look at it.

The PR is pretty large at the moment (+2,717 −3,358) and contains several different types of changes, which makes it harder to review.

Would it be possible to split as many changes out of the PR as possible that aren't directly related to webpack 5? For example these should be separate PRs:

  • Dropping support for Node 10
  • Adding a new ChainedValueMap concept (not sure I follow why this is needed? The PR description in a new PR would help me understand this)
  • Refactoring webpack-chain base classes (such as the new src/createClass/* additions)
  • The sorting some of the existing properties/keys or sections README sections alphabetically

Many thanks :-)

@0x1af2aec8f957
Copy link

@githoniel
A new type inference problem was found:webpack-contrib/terser-webpack-plugin#443 (comment)

@githoniel
Copy link
Contributor Author

Hi! Thank you for your work on this, and sorry for the delay in taking a look at it.

The PR is pretty large at the moment (+2,717 −3,358) and contains several different types of changes, which makes it harder to review.

Would it be possible to split as many changes out of the PR as possible that aren't directly related to webpack 5? For example these should be separate PRs:

  • Dropping support for Node 10
  • Adding a new ChainedValueMap concept (not sure I follow why this is needed? The PR description in a new PR would help me understand this)
  • Refactoring webpack-chain base classes (such as the new src/createClass/* additions)
  • The sorting some of the existing properties/keys or sections README sections alphabetically

Many thanks :-)

I will split this later

@robothot robothot mentioned this pull request Oct 8, 2021
): this;
devtoolNamespace(value: WebpackOutput['devtoolNamespace']): this;
filename(value: WebpackOutput['filename']): this;
assetModuleFilenamet(value: WebpackOutput['assetModuleFilename']): this;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@githoniel

Suggested change
assetModuleFilenamet(value: WebpackOutput['assetModuleFilename']): this;
assetModuleFilename(value: WebpackOutput['assetModuleFilename']): this;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submitted a pull request here before: githoniel#2

@edmorley
Copy link
Member

edmorley commented Oct 13, 2021

Would it be possible to split as many changes out of the PR as possible that aren't directly related to webpack 5? For example these should be separate PRs:

* Dropping support for Node 10

I've now done this in #318. I've also bumped the version on main to v7, since main now contains breaking changes.

Please could new PRs be created for these:

* Adding a new ChainedValueMap concept (not sure I follow why this is needed? The PR description in a new PR would help me understand this)
* Refactoring webpack-chain base classes (such as the new `src/createClass/*` additions)
* The sorting some of the existing properties/keys or sections README sections alphabetically

And just to emphasises - I don't have the time to work on this project myself (I'm not using webpack or doing much front-end any more), so people other than me will need to drive this work. Thank you for everyone's help so far! :-)

@denghongcai
Copy link

any progress here?

@Nic128
Copy link

Nic128 commented Jan 11, 2022

This PR has been published under https://www.npmjs.com/package/@gem-mine/webpack-chain before the requests here for change. I have been using that fork publish for my own private webpack 5 neutrino fork. I have not had much issues, at least for my usage.

The work involved here is to split the many changes into consumable bits. Makes for better changelogs and better reviews. As far as I know, no one has started the asked split.

@CoreyBin
Copy link

CoreyBin commented Feb 1, 2022

Hi, how long does it take to upgrade?

@suanmei
Copy link

suanmei commented Mar 15, 2022

image
Thanks for your work firstly.
There is a question about the Type Definition when I use config.devtool('eval-cheap-module-source-map').

Webpack5's sourceMap named-style is ^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$

@lindelleric
Copy link

Thanks for your work! Is there any ambition to finish this PR?

@AdvancedCat
Copy link

Hi, it's already year 2023 and I can't wait to use this new feature in webpack5. So, how is the progress going with that?

@imaegoo
Copy link

imaegoo commented Apr 18, 2023

Hi, it's already year 2023 and I can't wait to use this new feature in webpack5. So, how is the progress going with that?

@AdvancedCat An easy way is: yarn remove webpack-chain && yarn add -D @gem-mine/webpack-chain

@edmorley
Copy link
Member

edmorley commented Feb 3, 2024

Closing since this project is no longer maintained:
#358

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.