Skip to content

Add new decorated components and update dependencies#17

Open
Teodor Kulej (mt3o) wants to merge 1 commit intosaasquatch:mainfrom
mt3o:main
Open

Add new decorated components and update dependencies#17
Teodor Kulej (mt3o) wants to merge 1 commit intosaasquatch:mainfrom
mt3o:main

Conversation

@mt3o
Copy link

@mt3o Teodor Kulej (mt3o) commented Sep 12, 2024

Great lib you have created!
I thought it would be nice to leverage decorator to implement the hooks, instead of explicitly calling the function within the constructor. Additionally, it would be nice to enforce the presence of stencil hook methods. This is what i came with.

I had problems making the tests to run locally, even with your branch. Please review.

Description of the change

Implement class decorator to apply hooks instead of expecting the call to be executed directly in the constructor.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or Development tools (readme, specs, tests, code formatting)

Checklists

Development

  • Prettier was run (if applicable)
  • The behaviour changes in the pull request are covered by specs
  • All tests related to the changed code pass in development

Paperwork

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has a Jira number
  • This pull request has a Process.st launch checklist

Code review

  • Changes have been reviewed by at least one other engineer
  • Security impacts of this change have been considered

Introduced `DecoratedComponentTest` and `DecoratedComponentTestFail` in `components.tsx` with decorator `WithStencilHooks`. Also, updated various dependencies in `package.json` and `package-lock.json` to newer versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant