core(config): refactor config cloning for fraggle rock#11759
Conversation
| * @param {T} item | ||
| * @return {T} | ||
| */ | ||
| function shallowClone(item) { |
There was a problem hiding this comment.
this function used to be called cloneArrayWithPluginSafety (we used to call the custom audit/gatherer definition "plugin support") which became very misleading once we actually introduced plugin support that means something else. This is just more straightforward for what it was.
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable strict */ | |||
There was a problem hiding this comment.
is anyone else having this problem in vscode where eslint is marking 100% of our .d.ts files as failing because of the strictness? started happening for me once we switched to the typescript parser in eslint
There was a problem hiding this comment.
yup same. vscode's really unhappy with my .d.ts files.
| expect(input.categories.random.auditRefs[0].id).toEqual('user-timings'); | ||
| }); | ||
|
|
||
| it('should preserve gatherer implementations in passes', () => { |
There was a problem hiding this comment.
Nit: Perhaps it's cleaner this way and it doesn't really matter, but it seems a bit unnecessary for these to be separate cases. We could just have a "preserves implementations" test that covers all three cases as they are all testing the same function and behavior.
| @@ -1,3 +1,4 @@ | |||
| /* eslint-disable strict */ | |||
There was a problem hiding this comment.
yup same. vscode's really unhappy with my .d.ts files.
| export interface Json { | ||
| extends?: 'lighthouse:default' | string | boolean; | ||
| settings?: SharedFlagsSettings; | ||
| artifacts?: ArtifactJson[] | null; |
There was a problem hiding this comment.
ah that's pleasant.
I faintly remember some other hack where we allowed something to be expressed in JSON instead of read from a filepath. Ah, looks like it was --extra-headers.
nevermind carry on!
Summary
This PR is the first baby step toward the fraggle rock config.
config-helpersArtifactDefnconceptartifactsconfig propertyRelated Issues/PRs
ref #11313 #11748