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

Refactor / update services members visibility and explicit inject #590

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

ChristiaanScheermeijer
Copy link
Collaborator

When implementing services in other platforms we override certain existing services to add custom minor custom implementation.

But we have two problems with this:

We can't access injected services when extending a service because they are all declared private. This means we have to inject the same service a second time and name it something else (storageService2 for example).

The second problem is that when extending a class that injects services via the constructor, the injection fails when there is no @inject(Service) annotation. I believe this is because the class method descriptor is lost when extending the class, but I'm not sure. I think it's safer to explicit annotate the arguments which also makes it consistent.

Copy link

github-actions bot commented Aug 7, 2024

Visit the preview URL for this PR (updated for commit 79825f5):

https://ottwebapp--pr590-refactor-services-in-4tgqyc6e.web.app

(expires Fri, 04 Oct 2024 12:58:45 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c198f8a3a199ba8747819f7f1e45cf602b777529

@ChristiaanScheermeijer ChristiaanScheermeijer force-pushed the refactor/services-injection-and-visibility branch from 690082f to 79825f5 Compare September 4, 2024 12:56
@AntonLantukh AntonLantukh merged commit 22eaa57 into develop Sep 4, 2024
8 of 10 checks passed
@AntonLantukh AntonLantukh deleted the refactor/services-injection-and-visibility branch September 4, 2024 15:31
kiremitrov123 added a commit that referenced this pull request Sep 23, 2024
* feat(project): access bridge initial structure

* feat(project): yarn

* feat(project): add lint-staged

* feat(project): error for unused imports

* feat(project): remove not needed ls-lint

* feat(project): add access tests

* feat(project): rename error message

* feat(project): readme and docs

* chore: rename project in package

* feat(project): include SIMS authorization

* chore: replace jw/fet with standard prettier config

* chore: access-bridge changes to not trigger e2e tests

* chore: revert web env

* feat(project): add stripe products endpoint

* chore: yarn update

* feat(project): move types in common package

* feat(project): update allowed methods

* chore: rename stripe service fnc name

* feat(project): make authorization optional

* feat(project): redefine functions with obj params

* chore: consistent naming convention

* feat(project): add test fixtures

* feat(project): add tests for stripe

* feat(project): fine-tune error descriptions

* feat(project): add stripe checkout

* chore: move types in common

* chore: move types in common

* feat(project): add tests for stripe checkout

* feat(project): add more tests for checkout

* chore: stripe checkout params

* feat(project): add test mocks class

* feat(project): add metadata in stripe checkout

* feat(project): add viewer from auth token, handle plan external providers

* feat(project): add viewer from auth token, handle plan external providers

* chore: update readme

* feat(project): update docs

* feat(project): add account service

* chore: remove unused util fnc

* feat(project): add sentry

* feat(project): replace node with vite

* feat(project): refactor server to use express, refactor error handling as well as tests

* feat(project): add types for express

* chore: add .test in the test naimings

* fix: vite version mismatch

* feat(project): update docs

* chore: add dummy env variables in the test-unit-snapshot workflow

* feat(project): refactor services, decouple plans method

* feat(project): add sentry source mapping

* feat(project): add sentry version and environment

* chore: remove debug sentry

* feat(project): additional test build for not source mapping on test

* feat(project): add stripe billing portal endpoint

* chore: update readme

* chore: add stripe dummy secret on test-unit workflow

* chore: update checkout params

* feat(project): add cors middleware

* feat(project): add cors middleware

* feat(project): add site_id in the route

* feat(project): update port it can match google cloud run reqs

* feat(project): use newer version of node to make happy sentry

* feat(project): move error handling to the middleware

* feat(project): add refresh passport

* feat(project): simplify jw error usage

* feat(project): refactor routes and middlewares

* feat(project): refactor structure and namings

* feat(project): add missing case for refresh passport test

* feat(project): load envs at runtime

* fix(search): override search query cache (#594)

Co-authored-by: Mike van Veenhuijzen <[email protected]>

* feat(project): app metadata insertion

* chore(project): add apple smart banner tag via env var
* chore(project): add android native banner data via env var
* refactor(project): make code more readable
* refactor(project): add itunes related application metadata
* refactor(project): function rename

* feat(project): add injectable wrapper to common components (#598)

* refactor(project): update services members visibility and explicit inject (#590)

* feat(project): remove free and productIds from content-types.json (#605)

* fix(e2e): fix tests after cleeng api update (#606)

* chore(release): v6.6.0

* feat(project): refactor routes and middlewares

* feat(project): rebase and stuff

* feat(project): add generic payment service that other services will implement

* feat(project): update products to use our own types

* chore: add site_id in .env.example

* feat(project): add stripe error handler in middleware

* chore: update readme

* chore: update comments on stripe payment service

* chore: remove unused type

* feat(project): update sentry and logger

* chore: node-version

* chore: revert node version

* chore: update comment on checkout controller

* chore: revert node version

* chore: revert env to default

* feat(project): modify types for products and prices

* feat(project): add deployment file and docs

* chore: update readme paths

* feat(project): remove mode from checkout params

* feat(project): remove stripe type

* chore: remove vite build file

---------

Co-authored-by: langemike <[email protected]>
Co-authored-by: Mike van Veenhuijzen <[email protected]>
Co-authored-by: Roy Schut <[email protected]>
Co-authored-by: Christiaan Scheermeijer <[email protected]>
Co-authored-by: Carina Dragan <[email protected]>
Co-authored-by: Anton Lantukh <[email protected]>
Co-authored-by: Conventional Changelog Action <[email protected]>
This was referenced Sep 27, 2024
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.

3 participants