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

feat: add aot option to karma #28854

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yjaaidi
Copy link

@yjaaidi yjaaidi commented Nov 13, 2024

PR Checklist

Please check to confirm 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:

What is the current behavior?

Tests run in JIT only.

What is the new behavior?

Tests can run in AOT, using the new aot option.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Nov 13, 2024
})
class Hello {}

expect((Hello as any).ɵcmp.template.toString()).not.toContain('jit');
Copy link
Author

Choose a reason for hiding this comment

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

This is fragile and sensitive to any structural changes in JIT. It could easily cause false negatives.
What would be a better way to achieve this detection?

...BASE_OPTIONS,
aot: true,
/** Cf. {@link ../builder-mode_spec.ts} */
polyfills: ['zone.js', '@angular/localize/init', 'zone.js/testing'],
Copy link
Author

Choose a reason for hiding this comment

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

Should we factorize this in BASE_OPTIONS? or create a BASE_POLYFILLS? or an object mother: optionsMother.base().withPolyfills()?

@yjaaidi yjaaidi mentioned this pull request Nov 13, 2024
13 tasks
@clydin clydin added the target: minor This PR is targeted for the next minor release label Nov 15, 2024
@jkrems
Copy link
Contributor

jkrems commented Nov 15, 2024

Sorry for the lack of review so far but I just want to quickly say that I'm really excited to see this option added. aot all the things! 🎉 - goes back to working through final fixes for the rc candidate

@yjaaidi
Copy link
Author

yjaaidi commented Nov 15, 2024

No rush at all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: @angular-devkit/build-angular detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants