Skip to content

Conversation

@damyanpetev
Copy link
Member

@damyanpetev damyanpetev commented Sep 26, 2024

Related to #13712

Since the encapsulation runs our source using vm.runInNewContext with customRequire function https://github.com/angular/angular-cli/blob/e51b9068763a115fa27d06e2dd7988b34a3f677c/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts#L233-L236 that's strictly require our module resolve code fails with TypeError: require.resolve is not a function but that of course is only visible with log tracing on:
image

But even if that succeeded, we also have the patch to point the first service init for the Angular compilation into the project entry point and that doesn't support the newer application builders that switched to browser and server entry points instead of main. So fixed that as well.

Lastly, the very same encapsulation doesn't allow for debug session using ts-node anymore, since both that package (see TypeStrong/ts-node#802) and the experimental native typescript atm (nodejs/loaders#116) don't support that directly. So switched the launch config for VS Code to use the compiled migrations with tasks to enable source maps and since the encapsulation wrap adds 3 extra lines an additional patch for that as well - that might need some adjustments down the line, I see 18.2 switched to the native module wrap and that causes just one 1 line offset.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@jackofdiamond5 jackofdiamond5 added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Sep 30, 2024
@damyanpetev damyanpetev merged commit 53a54d9 into master Sep 30, 2024
5 checks passed
@damyanpetev damyanpetev deleted the dpetev/fix-ng-ls-migrations branch September 30, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migrations version: 18.2.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants