smapiot / piral

🚀 Framework for next generation web apps using micro frontends. ⭐️ Star to support our work!
https://piral.io
MIT License
1.71k stars 127 forks source link

Fix #579 (piral-ng destroying all modules instead of only the intended one) #580

Closed Siphalor closed 1 year ago

Siphalor commented 1 year ago

Prerequisites

Please make sure you can check the following boxes:

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

Description

Implements the second solution as outlined in #579.

It makes use of some Angular internals similarly to how Angular does for SSR: https://github.com/angular/angular/blob/main/packages/platform-server/src/server.ts

Remarks

My Angular knowledge is limited, but I tried my best at analyzing the issue and this solution. Let me know if I've missed anything.

While relying on Angular internals is hacky, I don't really think there's a better fix for this issue.

Thanks for the great work on this framework :D

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 1 year ago

File size impact

Merging hotfix/#579-ng-platforms into develop impact files as follow:

empty-piral (no impact)
Files new size
Unmodified (2) 32.3 kB (0 B / +0%) :ghost:
Total (2) 32.3 kB (0 B / +0%) :ghost:
minimal-piral (no impact)
Files new size
Unmodified (2) 250 kB (0 B / +0%) :ghost:
Total (2) 250 kB (0 B / +0%) :ghost:
sample-cross-fx (+0%)
Files new size
src/samples/sample-cross-fx/dist/release/index.95b832.js 2.11 MB :baby:
src/samples/sample-cross-fx/dist/release/main.d96d13.css 1.67 kB :baby:
src/samples/sample-cross-fx/dist/release/main.60294c.css deleted (-1.67 kB)
src/samples/sample-cross-fx/dist/release/index.189f61.js deleted (-2.11 MB)
src/samples/sample-cross-fx/dist/release/index.html 454 B (0 B / +0%) :ghost:
Total (5) 2.12 MB (+60 B / +0%) :arrow_upper_right:
sample-piral (no impact)
Files new size
Unmodified (3) 638 kB (0 B / +0%) :ghost:
Total (3) 638 kB (0 B / +0%) :ghost:
sample-piral-core (no impact)
Files new size
Unmodified (3) 304 kB (0 B / +0%) :ghost:
Total (3) 304 kB (0 B / +0%) :ghost:

Generated by @jsenv/file-size-impact during check-bundle-size#4059395469 on d544cf6