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

Core: Remove handlebars usage #29208

Merged
merged 8 commits into from
Sep 27, 2024
Merged

Core: Remove handlebars usage #29208

merged 8 commits into from
Sep 27, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Sep 25, 2024

Closes #29167

What I did

I removed the need for / use of handlebars

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/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 77.5 MB 77.7 MB 202 kB 4.29 0.3%
initSize 162 MB 162 MB -139 kB -1.52 -0.1%
diffSize 84.8 MB 84.5 MB -340 kB -3.44 -0.4%
buildSize 6.96 MB 6.96 MB 0 B -2.08 0%
buildSbAddonsSize 1.57 MB 1.57 MB 0 B -2.38 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.91 MB 1.91 MB 0 B -1.83 0%
buildSbPreviewSize 311 kB 311 kB 0 B -2.38 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.98 MB 3.98 MB 0 B -2.03 0%
buildPreviewSize 2.97 MB 2.97 MB 0 B -2.38 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.6s 14.5s -1s -61ms 0.79 -7.3%
generateTime 20.8s 21.1s 226ms -0.25 1.1%
initTime 16.3s 14.6s -1s -644ms -0.65 -11.2%
buildTime 8.6s 8.3s -314ms -1.95 -3.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.3s 6.5s 112ms -0.71 1.7%
devManagerResponsive 4.2s 4.2s 75ms -0.81 1.7%
devManagerHeaderVisible 521ms 518ms -3ms -1.92 -0.6%
devManagerIndexVisible 548ms 556ms 8ms -1.79 1.4%
devStoryVisibleUncached 970ms 995ms 25ms -0.87 2.5%
devStoryVisible 549ms 556ms 7ms -1.85 1.3%
devAutodocsVisible 493ms 494ms 1ms -1.23 0.2%
devMDXVisible 478ms 481ms 3ms -1.36 0.6%
buildManagerHeaderVisible 520ms 470ms -50ms -1.81 🔰-10.6%
buildManagerIndexVisible 558ms 471ms -87ms -1.9 🔰-18.5%
buildStoryVisible 594ms 547ms -47ms -1.94 🔰-8.6%
buildAutodocsVisible 442ms 454ms 12ms -1.76 2.6%
buildMDXVisible 438ms 417ms -21ms -1.74 🔰-5%

Greptile Summary

This PR removes the Handlebars dependency from Storybook, simplifying string manipulation in the codebase.

  • Replaced Handlebars template with JavaScript file in code/builders/builder-webpack5/templates/virtualModuleModernEntry.js
  • Updated code/builders/builder-webpack5/src/preview/virtual-module-mapping.ts to use string replacement instead of Handlebars
  • Removed handlebars dependency from code/core/package.json and related utility in code/core/src/common/utils/handlebars.ts
  • Eliminated code/builders/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars

@ndelangen ndelangen changed the title remove handlebars Core: Remove handlebars usage Sep 25, 2024
@ndelangen ndelangen self-assigned this Sep 25, 2024
@ndelangen ndelangen added maintenance User-facing maintenance tasks core ci:normal labels Sep 25, 2024
@ndelangen ndelangen requested a review from JReinhold September 25, 2024 13:47
@ndelangen ndelangen changed the title Core: Remove handlebars usage Core: Remove handlebars usage Sep 25, 2024
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

7 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

nx-cloud bot commented Sep 25, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit b7b2cdf. 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.

.vscode/settings.json Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:normal core maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from handlebars to simple string concats
2 participants