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

fix(angular): provide constructor dependencies #21059

Merged
merged 13 commits into from
Feb 20, 2023

Conversation

sheriffMoose
Copy link
Contributor

@sheriffMoose sheriffMoose commented Feb 11, 2023

Resolves #21052
Resolves #21051
Resolves #21121

What I did

  • provide moduleMetadata.providers into the root injector, still being provided into the standalone component for overrides
  • provide dependencies injected into components constructors into the root injector, in case they are providedIn: 'root' but they are missed by the standalone injector

How to test

  • Unit Tests Pass
  • CI Passes

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

Closes:
- [Bug]: Angular: No provider for XXX storybookjs#21052
- [Bug]: Angular: ControlValueAccessor is always set to null storybookjs#21051

This is needed because services that are { providedIn: 'root' } are not being read into the root injector when coupled with standalone components.

* [x] provide moduleMetadata.providers into the root injector, still being provided into the standalone component for overrides
* [x] provide dependencies injected into components constructors into the root injector, in case they are providedIn: 'root' but they are missed by the standalone injector
@valentinpalkovic
Copy link
Contributor

@sheriffMoose Can I help you with the failing UI Tests or do you know the issue?

@sheriffMoose
Copy link
Contributor Author

@valentinpalkovic yes please, didn't get the time to look at it yet

@socket-security
Copy link

socket-security bot commented Feb 16, 2023

Socket Security Pull Request Report

Dependency issues detected: If you merge this pull request, you will not be alerted to the instances of these issues again.

⚠️ Uses eval

Package uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Avoid packages that use eval, since this could potentially execute any code.

Package Eval Type Location Source
@ngxs/[email protected] (added) Function bundles/ngxs-store.umd.js code/frameworks/angular/package.json
@ngxs/[email protected] (added) Function bundles/ngxs-store.umd.min.js code/frameworks/angular/package.json
@ngxs/[email protected] (added) Function esm2015/src/internal/internals.js code/frameworks/angular/package.json
@ngxs/[email protected] (added) Function esm5/src/internal/internals.js code/frameworks/angular/package.json
@ngxs/[email protected] (added) Function fesm2015/ngxs-store.js code/frameworks/angular/package.json
@ngxs/[email protected] (added) Function fesm5/ngxs-store.js code/frameworks/angular/package.json
@reach/[email protected] (added) Function dist/utils.cjs.development.js test-storybooks/external-docs/package.json via [email protected]
@reach/[email protected] (added) Function dist/utils.cjs.production.min.js test-storybooks/external-docs/package.json via [email protected]
@reach/[email protected] (added) Function dist/utils.esm.js test-storybooks/external-docs/package.json via [email protected]
@sinclair/[email protected] (added) Function compiler/compiler.js code/package.json via @storybook/[email protected], code/frameworks/angular/package.json via [email protected], [email protected], code/presets/create-react-app/package.json via [email protected]
@sinclair/[email protected] (added) Function conditional/structural.js code/package.json via @storybook/[email protected], code/frameworks/angular/package.json via [email protected], [email protected], code/presets/create-react-app/package.json via [email protected]
@sinclair/[email protected] (added) Function errors/errors.js code/package.json via @storybook/[email protected], code/frameworks/angular/package.json via [email protected], [email protected], code/presets/create-react-app/package.json via [email protected]
@sinclair/[email protected] (added) Function value/cast.js code/package.json via @storybook/[email protected], code/frameworks/angular/package.json via [email protected], [email protected], code/presets/create-react-app/package.json via [email protected]
@sinclair/[email protected] (added) Function value/check.js code/package.json via @storybook/[email protected], code/frameworks/angular/package.json via [email protected], [email protected], code/presets/create-react-app/package.json via [email protected]
@sinclair/[email protected] (added) Function value/create.js code/package.json via @storybook/[email protected], code/frameworks/angular/package.json via [email protected], [email protected], code/presets/create-react-app/package.json via [email protected]
@storybook/[email protected] (added) Function dist/formatter-UBTKRH7D.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/formatter-UBTKRH7D.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/index.js test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/index.js test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/index.js code/package.json via @storybook/[email protected]
@storybook/[email protected] (added) Function dist/index.mjs code/package.json via @storybook/[email protected]
@storybook/[email protected] (added) Function dist/cjs/index.js code/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], code/addons/interactions/package.json via @storybook/[email protected], @storybook/[email protected], scripts/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/esm/index.js code/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], code/addons/interactions/package.json via @storybook/[email protected], @storybook/[email protected], scripts/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/modern/index.js code/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], code/addons/interactions/package.json via @storybook/[email protected], @storybook/[email protected], scripts/package.json via @storybook/[email protected], @storybook/[email protected]
@storybook/[email protected] (added) Function dist/chunk-25XCUBXP.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
@storybook/[email protected] (added) Function dist/index.js test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
@storybook/[email protected] (added) Function dist/utils.js test-storybooks/ember-cli/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
@storybook/[email protected] (added) Function dist/chunk-WSFJTVX5.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
@storybook/[email protected] (added) Function dist/chunk-WSFJTVX5.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
@storybook/[email protected] (added) Function dist/chunk-WSFJTVX5.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
@storybook/[email protected] (added) Function dist/chunk-WSFJTVX5.mjs test-storybooks/ember-cli/package.json via @storybook/[email protected], [email protected], test-storybooks/external-docs/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/server-kitchen-sink/package.json via @storybook/[email protected], @storybook/[email protected], [email protected], test-storybooks/standalone-preview/package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
[@storybook/[email protected]

@valentinpalkovic valentinpalkovic merged commit 4d0355f into storybookjs:next Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants