Repository navigation
Conversation
The regression was introduced here: https://github.com/netlify/cli/pull/7112/files#r2005549184. This was introduced because the `DevConfig` type was incorrect and the weak type assertion (and general type weakness in this codebase) allowed it. This also fixes a few nearby type isues.
📊 Benchmark resultsComparing with 719c17c
|
serhalp
commented
Mar 25, 2025
| @@ -8,23 +8,14 @@ export type BuildConfig = NonNullable<NetlifyTOML['build']> | |||
| export type DevConfig = NonNullable<NetlifyTOML['dev']> & { | |||
Member
Author
There was a problem hiding this comment.
You can see here we're extending this type, but we were duplicating most of it here. Most of this diff is cleaning up this unnecessary duplication + adding undefined to optional properties.
serhalp
commented
Mar 25, 2025
|
|
||
| jwtSecret: string | ||
| jwtRolePath: string | ||
| pollingStrategies?: PollingStrategy[] |
Member
Author
There was a problem hiding this comment.
This is normalized to a string before it gets here: https://github.com/netlify/build/blob/1b9f2f40de7ded6285e9b7c08a1adb43550a0ccf/packages/build-info/src/settings/get-build-settings.ts#L102
serhalp
commented
Mar 25, 2025
| dist: devConfig.publish || getDefaultDist(workingDir), | ||
| framework: '#custom', | ||
| pollingStrategies: devConfig.pollingStrategies?.map((s) => s.name) ?? [], | ||
| pollingStrategies: devConfig.pollingStrategies ?? [], |
Member
Author
There was a problem hiding this comment.
This is the regression/fix
serhalp
commented
Mar 25, 2025
Comment on lines
-15
to
+16
| pollingStrategies: { name: string }[] | ||
| pollingStrategies: PollingStrategy[] |
Member
Author
There was a problem hiding this comment.
This one was correct. I made it reference the canonical type while I was here.
JakeChampion
approved these changes
Mar 25, 2025
ndhoule
approved these changes
Mar 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7124.
The regression was introduced here: https://github.com/netlify/cli/pull/7112/files#r2005549184. The detected framework config's
pollingStrategiesproperty was no longer being threaded through correctly.This was introduced because the
DevConfigtype was incorrect and the weak type assertion (and general type weakness in this codebase) allowed it.This also fixes a few nearby type isues.