Commit Graph

685 Commits

Author SHA1 Message Date
Sean Larkin 4fada307a7 fix(types): Correct chunkgroup.groupsIterable return type 2023-05-16 05:01:58 +00:00
Nitin Kumar 12f958869f fix: udpate types 2023-05-09 21:40:59 +05:30
Sean Larkin f21b30adb9 yarn fix 2023-05-04 23:32:36 +00:00
Sean Larkin e958ac552b refactor(types): Improve module type strictness and refactor module type string usages in module subclasses 2023-05-04 23:19:11 +00:00
Michael Zlatkovsky 83d14b13e1 Merge remote-tracking branch 'origin/main' into zlatkovsky/trusted-types-options 2023-05-02 14:58:15 -07:00
Michael Zlatkovsky 2203e24900 Add option to continue on trusted-types policy-creation failure
Webpack already allows for specifying a trusted-types policy name. However, its current implementation is such that if a call to trustedTypes.createPolicy fails, the code will immediately stop executing. This isn't necessarily desirable, as an application could be in the early phases of rolling out trusted types, and thus have the CSP rule for trusted-types LibraryA LibraryB etc, BUT have require-trusted-types-for 'script' be in "report only" mode (Content-Security-Policy-Report-Only). In such a configuration, and when the webpacked code is dynamically-loaded into an application, adding the policy name to the webpack config will break old versions.

This PR keeps the original behavior, but introduces a new option for onPolicyCreationFailure: "continue" | "stop" (with "stop" remaining the default). If a developer chooses the "continue" option, the policy-creation will be wrapped in a try/catch. There is no security risk to this, since for host applications that DO have strict enforcement of trusted-types, the code will simply fail when the dangerous sink is used (e.g., when doing parseFromString). And likewise, wrapping in try/catch and doing nothing on catch is OK, because the code already deals with the possibility of the trustedTypes API not being available on the browser.
2023-05-02 10:12:56 -07:00
alexander.akait 3498d5fb97 chore: update types 2023-05-02 12:55:44 +03:00
Sean Larkin f3389577ef refactor(types): Increase type coverage & docs for B.E.E 2023-04-28 19:21:02 +00:00
Sean Larkin a051a7be54 add new type updates supporting the new type coverage in parser 2023-04-28 18:06:33 +00:00
Sean Larkin 5b20c9af1c
Merge pull request #17057 from webpack/import-support
feat: CSS import and allow to hook module creation
2023-04-26 04:14:45 -07:00
Sean Larkin 2c6dc778ab
Merge pull request #16388 from indeediansbrett/feat/issue-16374
feat: ignoreBrowserWarnings option to ignore browser console warnings
2023-04-25 20:51:46 -07:00
alexander.akait 4b287e1bad fix: types 2023-04-25 19:37:59 +03:00
Rômulo Ruas 3712e9af4c
Sort type exports alphabetically 2023-04-24 16:51:47 +02:00
Rômulo Ruas 8a5b66e758
Export MemoryCacheOptions in types.d.ts 2023-04-24 15:19:43 +02:00
Sean Larkin 3026ad9b81 types(coverage): Increase type coverage of ModuleFilenameHelpers 2023-04-23 02:43:51 +00:00
alexander.akait 94b594511e fix: types 2023-04-22 05:42:04 +03:00
alexander.akait 713b187c2d fix: types 2023-04-22 05:26:43 +03:00
alexander.akait 7a929533dd fix: types 2023-04-22 04:18:17 +03:00
alexander.akait 4f6dc32d38 chore: improve types 2023-04-21 19:22:33 +03:00
alexander.akait 02590bfdc7 chore: improve types 2023-04-21 19:22:33 +03:00
alexander.akait 519da161cc chore(deps): update typescript 2023-04-21 19:22:33 +03:00
Sam Brett f5d368efa6 feat: ignoreBrowserWarnings option to ignore browser console warnings 2023-04-20 10:51:37 -07:00
Sean Larkin 58396f52f7 introduce the new types from enhanced-resolve 2023-04-19 15:17:35 +00:00
Sean Larkin 9d39104867
Merge pull request #15450 from webpack/feature/errors-warnings-space
feature errorsSpace, warningsSpace
2023-04-18 19:02:40 -07:00
Sean Larkin 06d5e562c5
Merge pull request #15198 from stefanprobst/fix/pass-package-type-to-loader-runner
fix: pass package type to loader runner
2023-04-18 18:42:59 -07:00
Ivan Kopeykin e6c7a57e33 Merge branch 'main' into feature/errors-warnings-space 2023-04-12 18:08:16 +03:00
Sean Larkin 3b8c9c613e
Merge pull request #16419 from karlhorky/patch-1
Add NormalModuleReplacementPlugin argument type
2023-04-12 07:49:33 -07:00
Sean Larkin 66f647260d
Merge pull request #12774 from snitin315/export-more-types
Export more types
2023-04-12 07:39:57 -07:00
Sean Larkin 4cacd7e956
Merge pull request #16941 from webpack/feat/destructuring-assignment
Add support for destructuring assignment in parser. Enables tree-shaking for destructuring assignment in simple use cases.
2023-04-12 07:30:52 -07:00
Nitin Kumar 5460618513 export type ExternalItemObjectUnknown 2023-04-11 01:50:17 +00:00
Nitin Kumar 5ae5feb26b export type ExternalItemObjectKnown 2023-04-11 01:50:17 +00:00
Nitin Kumar d59e5fab85 export type ExternalItemValue 2023-04-11 01:50:17 +00:00
Nitin Kumar ba47e6c606 export type ExternalItemFunctionData 2023-04-11 01:50:17 +00:00
Nitin Kumar 9ecc2f8374 feat: export type Externals 2023-04-11 01:50:03 +00:00
Ivan Kopeykin 45754f45d0 rename some properties, add more test cases 2023-04-09 10:44:09 +03:00
alexander.akait 370b099071 chore: update @types/estre 2023-04-08 02:07:37 +03:00
Ivan Kopeykin 9bb35fb998 support destructuring assignment in parser 2023-04-07 22:29:32 +03:00
alexander.akait 83185a4c68 chore: update types 2023-04-06 20:37:17 +03:00
Ivan Kopeykin e4a024f9b1 Merge branch 'main' into feature/errors-warnings-space
# Conflicts:
#	schemas/WebpackOptions.check.js
2023-04-06 11:43:05 +03:00
long76 c5ac0d39c4
Merge branch 'main' into patch-1 2023-03-25 13:53:20 +03:00
Thomas Tay f33c2b07d0
Merge branch 'webpack:main' into main 2023-03-22 15:27:50 +08:00
Stefan Probst 8d20f388cb
test: add test case 2023-03-20 08:22:15 +01:00
Thomas Tay 9e3f5bb0da update snapshots and more special lint fix 2023-03-16 10:28:11 +08:00
Sean Larkin 796b51175c
Merge pull request #16805 from snitin315/fix/improve-source-types
Improve types for `webpack-sources` to match in webpack core.
2023-03-14 08:58:36 -07:00
Nitin Kumar 27b6dce48f fix: improve types for `webpack-sources` 2023-03-11 08:20:02 +05:30
Adam Skoufis 5f34acfbc0
feat: Add `target` to `LoaderContext` type 2023-03-07 09:45:21 +11:00
Thomas Tay 7ef871b742 lint fix (somehow by version of Prettier adds this but on linux it doesn't???) 2023-01-27 12:05:33 -08:00
Thomas Tay 13be78b0b8 lint fixes 2023-01-25 13:09:47 -08:00
Thomas Tay 7a1ccea945 change json schema description 2023-01-25 12:28:15 -08:00
Thomas Tay c188270d13
Merge branch 'webpack:main' into main 2023-01-25 12:06:59 -08:00