-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(utils): adds waitFor util #39
Conversation
Danke für's feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sieht schon ganz gut aus.
Schau noch mal auf die Kommentare, ob man da noch was machen muss.
} | ||
}); | ||
|
||
cyclicErrorObservable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die cyclic error detection über ein observable laufen zu lassen kommt wir etwas zu komplex vor.
Werden damit async Probleme gelöst?
Ansonsten könnte man ja auch einfach direkt beim waitFor Aufruf als erstes buildDependencies aufrufen und prüfen ob ein Zyklus entstanden ist. Es muss ja nicht zwingend jeder waitFor der in dem Zyklus hängt eine Exception werfen. Es reicht ja der Aufruf, der den Zyklus schließt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ich hab mal ein bisschen ohne observable rumgespielt. Dann muss man ab der ersten cyclic dependency alles rejecten weil man ja nie weiß wer gerade für das schließen verantwortlich ist. Die transforms dauern ja im Zweifel alle unterschiedlich lang. Mit den Observables kann man das schön zuordnen :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
würde es daher drin lassen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ein kleines wording in der readme ist mir noch aufgefallen, sonst können wir das so lassen.
packages/contentful-ssg/README.md
Outdated
###### waitFor | ||
|
||
Wait for specific entry to be transformed. | ||
Be aware that this can lead to dead ends when you're awaiting something which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du meinst bestimmt "deadlock" und nicht "dead end" (Sackgasse)
packages/contentful-ssg/src/index.ts
Outdated
@@ -115,6 +128,12 @@ export const run = async (config: Config): Promise<void> => { | |||
await write({ ...transformContext, content }, ctx, config); | |||
ctx.stats.addSuccess(transformContext); | |||
} catch (error: unknown) { | |||
if (error instanceof Error) { | |||
subject.next({ ...transformContext, error }); | |||
} else if (typeof error === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich hab überlegt, ob man den Fall abfangen müsste, dass der error kein Error und kein string ist.
Wäre ein bisschen robuster gebaut, aber wird vermutlich nie auftreten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hatte ich auch erst drin, habs aber direkt wieder zurückgebaut.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sieht jetzt gut aus
* main: (23 commits) chore(release): updated release notes and package versions [ci skip] fix(observable): uses ReplaySubject for transforms chore(release): updated release notes and package versions [ci skip] Fix: avoid skipping link entries in submenus (#42) chore(release): updated release notes and package versions [ci skip] Fix: avoid skipping link entries in menus builder (#41) ci(tests): disable shallow clone in github actions workflow ci(tests): tweaks coverage exclusions in sonar.properties ci(tests): tweaks sonar.properties ci(tests): tweaks sonar.properties ci(tests): tweaks sonar.properties ci(tests): tweaks sonar properties ci(tests): adds sonarcloud to test.yml (#40) fix(tests): adds sonar reporter ci(tests): adds sonarqube to test.yml chore(release): updated release notes and package versions [ci skip] feat(utils): adds waitFor util (#39) chore(release): updated release notes and package versions [ci skip] Feature: enable custom hugo menu (#38) chore(release): updated release notes and package versions [ci skip] ...
No description provided.