Skip to content

Conversation

R1D3R175
Copy link
Contributor

@R1D3R175 R1D3R175 commented Jul 25, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

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

What changes does this PR introduce?

Upgrade to Angular v20

Does this PR introduce a breaking change?

  • Yes
  • No

@R1D3R175
Copy link
Contributor Author

R1D3R175 commented Jul 25, 2025

Currently test fail because of registerAndGetStore and registerAndGetImmutableStore

Error

TypeError: Cannot read properties of null (reading 'ngModule')

      at isModuleWithProviders (packages/signalstory/node_modules/@angular/core/fesm2022/debug_node.mjs:11956:18)
      at expandModuleWithProviders (packages/signalstory/node_modules/@angular/core/fesm2022/debug_node.mjs:29117:9)
          at Array.map (<anonymous>)
      at Function.get (packages/signalstory/node_modules/@angular/core/fesm2022/debug_node.mjs:28754:26)
      at getNgModuleDef (packages/signalstory/node_modules/@angular/core/fesm2022/root_effect_scheduler.mjs:1473:12)
      at getNgModuleDefOrThrow (packages/signalstory/node_modules/@angular/core/fesm2022/root_effect_scheduler.mjs:1476:25)
      at verifySemanticsOfNgModuleDef (packages/signalstory/node_modules/@angular/core/fesm2022/debug_node.mjs:28843:23)
      at Function.get (packages/signalstory/node_modules/@angular/core/fesm2022/debug_node.mjs:28798:30)
      at TestBedCompiler.applyProviderOverridesInScope (packages/signalstory/node_modules/@angular/core/fesm2022/testing.mjs:1179:29)
      at TestBedCompiler.compileTestModule (packages/signalstory/node_modules/@angular/core/fesm2022/testing.mjs:1507:14)
      at TestBedCompiler.finalize (packages/signalstory/node_modules/@angular/core/fesm2022/testing.mjs:1012:14)
      at _TestBedImpl.get testModuleRef [as testModuleRef] (packages/signalstory/node_modules/@angular/core/fesm2022/testing.mjs:2071:49)
      at _TestBedImpl.inject (packages/signalstory/node_modules/@angular/core/fesm2022/testing.mjs:1984:29)
      at Function.inject (packages/signalstory/node_modules/@angular/core/fesm2022/testing.mjs:1827:37)
      at registerAndGetStores (packages/signalstory/src/__tests__/helper.ts:59:19)
      at packages/signalstory/src/__tests__/store.spec.ts:266:32
      at _ZoneDelegate.invoke (node_modules/zone.js/fesm2015/zone.js:369:28)
      at _ProxyZoneSpec.onInvoke (node_modules/zone.js/fesm2015/zone-testing.js:2082:39)
      at _ZoneDelegate.invoke (node_modules/zone.js/fesm2015/zone.js:368:34)
      at _ZoneImpl.run (node_modules/zone.js/fesm2015/zone.js:111:43)
      at Object.wrappedFunc (node_modules/zone.js/fesm2015/zone-testing.js:406:34)

@R1D3R175
Copy link
Contributor Author

Seems like it was a circular dependency issue. By the deleting packages/signalstory/node_modules all tests pass.

@R1D3R175
Copy link
Contributor Author

R1D3R175 commented Jul 25, 2025

Tree-shaking fails, will try to look into it but never used it so don't really know what I'm doing tbh

Output

"@angular/core" is imported by "dist/signalstory/fesm2022/signalstory.mjs", but could not be resolved – treating it as an external dependency.
"rxjs" is imported by "dist/signalstory/fesm2022/signalstory.mjs", but could not be resolved – treating it as an external dependency.
import { signal } from '@angular/core';
import 'rxjs';

/*@__PURE__*/ signal([], ...(ngDevMode ? [{ debugName: "runningEffects" }] : []));

Failed to tree-shake dist/signalstory/fesm2022/signalstory.mjs

@zuriscript
Copy link
Owner

Hi @R1D3R175
Thanks a lot for your contribution.
I am a little busy lately, so I really appreciate your effort.
About the treeshakeability, as it has worked before, it seems that the new rollup version bundeled in angular is not able to tree-shake runningEffects in plugin-status.ts. I will check this quickly

@zuriscript
Copy link
Owner

zuriscript commented Jul 26, 2025

Hi @R1D3R175
I have merged a fix into main.
You can merge/rebase to your Branch and the checks should pass.

One more thing, could you update the announcement bar as well?
See: 64dee9d

zuri-ti8m and others added 2 commits July 29, 2025 10:34
…runningEffects"

With Angular 20, the new rollup version seems not to be able to successfully remove runningEffects,
eventhough it is sideeffect free and annotated with PURE.

This change does not alter the behaviour but makes it recognizable as sideeffect free.
@R1D3R175 R1D3R175 marked this pull request as ready for review July 29, 2025 08:36
@R1D3R175
Copy link
Contributor Author

R1D3R175 commented Jul 29, 2025

Hi @zuriscript
Now everything should be good, npm run check says that its fully tree-shakeable

@zuriscript zuriscript merged commit bd3b864 into zuriscript:master Jul 31, 2025
@zuriscript
Copy link
Owner

@R1D3R175 Thanks a lot for the effort, angular 20.0.0 support is now official!

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.

3 participants