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(vite-plugin-angular): remove numbers from beginning of file name selector #952

Merged

Conversation

joshuamorony
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • vite-plugin-angular
  • vite-plugin-nitro
  • astro-angular
  • create-analog
  • router
  • platform
  • content
  • nx-plugin
  • trpc

What is the current behavior?

Similar to #919

When attempting to create a component using a .agx file:

  import(
    `../../../content/modules/lessons/angular-getting-started/01-generating-angular-app.agx`
  ).then((m) => {
    divPost().createComponent(m.default);
    cdr.detectChanges();
  });

It will fail if the file name begins with numbers, as this is used to generate a selector for the component of 01-generating-angular-app and then createComponent will try to use that as the tag name but it is invalid.

What is the new behavior?

This change strips any leading numbers/hyphen from the selector generated from the file name, so 01-generating-angular-app.agx would result in a selector of generating-angular-app

This change applies to all file name based selectors not just .agx files

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

[optional] What gif best describes this PR or how it makes you feel?

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for analog-ng-app ready!

Name Link
🔨 Latest commit c67b404
🔍 Latest deploy log https://app.netlify.com/sites/analog-ng-app/deploys/65fba558deb7d70008824b9e
😎 Deploy Preview https://deploy-preview-952--analog-ng-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit c67b404
🔍 Latest deploy log https://app.netlify.com/sites/analog-blog/deploys/65fba558800adf0008e9a050
😎 Deploy Preview https://deploy-preview-952--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit c67b404
🔍 Latest deploy log https://app.netlify.com/sites/analog-docs/deploys/65fba558e8e64d00086e7bfe
😎 Deploy Preview https://deploy-preview-952--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit c67b404
🔍 Latest deploy log https://app.netlify.com/sites/analog-app/deploys/65fba558a584100008f988f3
😎 Deploy Preview https://deploy-preview-952--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brandonroberts brandonroberts merged commit 528a5d8 into analogjs:main Mar 23, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants