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

Introduce package for Features #7242

Merged
merged 1 commit into from Feb 28, 2023
Merged

Introduce package for Features #7242

merged 1 commit into from Feb 28, 2023

Conversation

jansav
Copy link
Contributor

@jansav jansav commented Feb 27, 2023

This feature-core package will allow us to start extending the application without relying current Extension API.

Expect future PRs to showcase usage.

@jansav jansav added the enhancement New feature or request label Feb 27, 2023
@jansav jansav added this to the 6.5.0 milestone Feb 27, 2023
@jansav jansav requested a review from a team as a code owner February 27, 2023 08:44
@jansav jansav requested review from Nokel81 and aleksfront and removed request for a team February 27, 2023 08:44
ixrock
ixrock previously approved these changes Feb 27, 2023
Comment on lines +15 to +19
const registerFeatureRecursed = (
di: DiContainer,
feature: Feature,
dependedBy?: Feature
) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is more readable imho + there is no actual reason to use arrow-function, this context is not even considered).

Suggested change
const registerFeatureRecursed = (
di: DiContainer,
feature: Feature,
dependedBy?: Feature
) => {
function registerFeatureRecursed(di: DiContainer, feature: Feature, dependedBy?: Feature) {


#### NPM packages exporting a Feature
- Prefer `peerDependencies` since they are installed from the application and are not allowed to be in the built bundle.
- Prefer exporting `injectionToken` instead of `injectable` for not allowing other features to access technical details like the `injectable`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the example above show this then. Not the best if the best practice is not shown in the only example code.

Copy link
Contributor Author

@jansav jansav Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just example which shows how Feature is created. We will have scaffolding for Features which will demonstrate both bullet points. And link for that will be updated here.

Base automatically changed from chore/injectable-bump to master February 27, 2023 19:27
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Copy link
Contributor

@jakolehm jakolehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nokel81 Nokel81 merged commit c174965 into master Feb 28, 2023
@Nokel81 Nokel81 deleted the feat/feature-core branch February 28, 2023 13:37
@Nokel81 Nokel81 mentioned this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants