Skip to content
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

Use of services for all block fixtures #1265

Closed
wants to merge 9 commits into from

Conversation

raphaelblum
Copy link
Contributor

@raphaelblum raphaelblum commented Sep 14, 2023

fixtures for all blocks in the page-content.block.ts + typing in page-content.generator.ts to enforce creating a fixture when adding a block to the page-content.block.ts

Screen.Recording.2023-09-15.at.12.21.44.mov

@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch 3 times, most recently from 2665d45 to dc5d9ad Compare September 15, 2023 10:18
@raphaelblum raphaelblum changed the title Draft: Fixture blocks as services Fixture blocks as services Sep 15, 2023
@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch from dc5d9ad to 75dbf72 Compare September 15, 2023 10:31
@johnnyomair johnnyomair requested a review from nsams September 18, 2023 15:04
@raphaelblum raphaelblum changed the title Fixture blocks as services Draft: Fixture blocks as services Oct 5, 2023
@johnnyomair johnnyomair marked this pull request as draft October 10, 2023 14:19
@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch 2 times, most recently from ece5320 to b670776 Compare October 17, 2023 11:35
@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch 3 times, most recently from 55ee7a3 to b40738e Compare December 7, 2023 13:38
@raphaelblum raphaelblum changed the title Draft: Fixture blocks as services Fixture blocks as services Dec 7, 2023
@raphaelblum raphaelblum changed the title Fixture blocks as services Use of services for all block fixtures Dec 7, 2023
@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch from b40738e to abca001 Compare December 7, 2023 13:53
@raphaelblum raphaelblum marked this pull request as ready for review December 7, 2023 14:38
@johnnyomair
Copy link
Collaborator

Should we use generator, or fixture service?

@johnnyomair
Copy link
Collaborator

@nsams what's your opinion on this? Having a service for each block results in a lot of services, but using DI is definitely better than passing repositories/services around in generator functions

@raphaelblum
Copy link
Contributor Author

Should we use generator, or fixture service?

For the page and link fixtures the name "generator" was to generic, and I agree:
#968 (comment)

So I would call them here fixture service as well.

@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch from 04dad1a to cc2b12e Compare December 28, 2023 14:10
@raphaelblum raphaelblum force-pushed the fixture-blocks-as-services branch from 5457800 to 7a1c2c8 Compare January 2, 2024 10:29
@johnnyomair
Copy link
Collaborator

Two thoughts:

  1. The generators generate the block input, and not the block data. Should we change the method names to generateBlockInput()?
  2. How do you plan to move parts of the generators in the library?

@raphaelblum
Copy link
Contributor Author

  1. The generators generate the block input, and not the block data. Should we change the method names to generateBlockInput()?

yes, I'll update it

  1. How do you plan to move parts of the generators in the library?

Every block that exists in the library should also have a fixture generator in the library (+ some configuration options will be required I think, for example the videos for the youtube video block should probably be defined in the project and not in the library)

For new blocks in the project, a new fixture file has to be created manually in the project. (Although I would also like this to be automated, perhaps an extension of the api generator?)

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
@johnnyomair johnnyomair deleted the fixture-blocks-as-services branch July 29, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants