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

Angular: Default to standalone components in Angular v19 #29677

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

ingowagner
Copy link
Contributor

@ingowagner ingowagner commented Nov 20, 2024

Closes #29671

What I did

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 78.4 MB 78.4 MB 0 B -0.22 0%
initSize 144 MB 144 MB 0 B -0.64 0%
diffSize 65.1 MB 65.1 MB 0 B -0.83 0%
buildSize 6.83 MB 6.83 MB 0 B -1.05 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B -1.09 0%
buildSbPreviewSize 271 kB 271 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.83 MB 3.83 MB 0 B -1.09 0%
buildPreviewSize 3 MB 3 MB 0 B 0.95 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 15.5s 6.6s -8s -879ms -1.7 🔰-134.1%
generateTime 19.4s 19.4s -24ms -0.55 -0.1%
initTime 13.3s 13.1s -211ms -1.01 -1.6%
buildTime 7.7s 7.5s -179ms -1.33 -2.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.8s 7.5s 1.6s 2.84 🔺22.4%
devManagerResponsive 3.5s 4.6s 1.1s 3.34 🔺24%
devManagerHeaderVisible 587ms 736ms 149ms 2.6 🔺20.2%
devManagerIndexVisible 668ms 832ms 164ms 2.41 🔺19.7%
devStoryVisibleUncached 1.2s 1.1s -108ms 0.54 -9.5%
devStoryVisible 624ms 824ms 200ms 2.6 🔺24.3%
devAutodocsVisible 542ms 739ms 197ms 4.73 🔺26.7%
devMDXVisible 701ms 674ms -27ms 2.22 -4%
buildManagerHeaderVisible 584ms 850ms 266ms 4.68 🔺31.3%
buildManagerIndexVisible 603ms 910ms 307ms 5.08 🔺33.7%
buildStoryVisible 583ms 849ms 266ms 4.6 🔺31.3%
buildAutodocsVisible 479ms 608ms 129ms 2.34 🔺21.2%
buildMDXVisible 478ms 611ms 133ms 3.23 🔺21.8%

Greptile Summary

This PR modifies the standalone component behavior in Angular's PropertyExtractor to align with Angular 19's new default where components are standalone by default unless explicitly specified otherwise.

  • Added version check using VERSION.major to determine default isStandalone value in PropertyExtractor.analyzeDecorators
  • Set isStandalone to true by default for Angular >= 19 when undefined
  • Set isStandalone to false by default for Angular < 19 when undefined
  • Maintains existing decorator analysis logic for explicitly defined standalone values

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@ingowagner ingowagner changed the title fix: isStandalone defaults to true if angular >= 19 Fix: isStandalone defaults to true if angular >= 19 Nov 20, 2024
@yannbf yannbf changed the title Fix: isStandalone defaults to true if angular >= 19 Angular: Default to standalone components in Angular v19 Nov 20, 2024
@yannbf yannbf added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Nov 20, 2024
@yannbf
Copy link
Member

yannbf commented Nov 20, 2024

Hey @ingowagner thank you so much for your contribution! <3

Copy link

nx-cloud bot commented Nov 20, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1c9f923. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@yannbf yannbf added ci:merged Run the CI jobs that normally run when merged. and removed ci:normal labels Nov 20, 2024
auto-merge was automatically disabled November 21, 2024 01:12

Head branch was pushed to by a user without write access

@yannbf yannbf merged commit 8ba4fb5 into storybookjs:next Nov 21, 2024
65 of 67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
angular bug ci:merged Run the CI jobs that normally run when merged. patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
3 participants