Skip to content

Conversation

@cexbrayat
Copy link
Member

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 new behavior?

As 3acb776 introduced an optimization for projects that use isolatedModules, this commit makes projects generated with ng new use this option by default.

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 Jul 3, 2024
@alan-agius4 alan-agius4 requested a review from clydin July 3, 2024 14:44
@cexbrayat
Copy link
Member Author

It looks like only one i18n test is failing (extract-ivy-library) but only when running with esbuild enabled:

It seems that in that case the messages from app.component.html are referenced as src/app/app.component.ts

Test Process error Error: File "messages.xlf" did not contain "src/app/app.component.html"...
Content:
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
  <file source-language="en-US" datatype="plaintext" original="ng2.template">
    <body>
      <trans-unit id="5640424602650517303" datatype="html">
        <source> i18n-lib-test works! </source>
        <context-group purpose="location">
          <context context-type="sourcefile">projects/i18n-lib-test/src/lib/i18n-lib-test.component.ts</context>
          <context context-type="linenumber">9,10</context>
        </context-group>
      </trans-unit>
      <trans-unit id="2023484548631819319" datatype="html">
        <source>Hello world</source>
        <context-group purpose="location">
          <context context-type="sourcefile">src/app/app.component.ts</context>
          <context context-type="linenumber">16</context>
        </context-group>
      </trans-unit>
    </body>
  </file>
</xliff>

@clydin
Copy link
Member

clydin commented Jul 3, 2024

Yes. I re-ran it so it's not a flake.
It appears this will need further investigation.

@cexbrayat
Copy link
Member Author

Yeah, I confirm that this is an issue: I just ran ng extract-i18n on a project of mine with isolatedModules: true, and the extracted messages only reference the TS files instead of the HTML files, line numbers are off, and equiv-text is broken.

@clydin
Copy link
Member

clydin commented Jul 3, 2024

#27992 should fix the underlying issue.

As 3acb776 introduced an optimization for projects that use `isolatedModules`,
this commit makes projects generated with `ng new` use this option by default.
@cexbrayat cexbrayat force-pushed the feat/isolated-modules branch from 16caf62 to 5cb736d Compare July 4, 2024 06:06
@cexbrayat
Copy link
Member Author

@clydin I rebased on your fix, and the PR is now green 👍

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Jul 8, 2024
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 8, 2024
@alan-agius4 alan-agius4 merged commit 4da922e into angular:main Jul 8, 2024
@cexbrayat cexbrayat deleted the feat/isolated-modules branch July 8, 2024 13:53
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker 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