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

build(single-spa-angular): move internal functions to single-spa-angular/internals package #178

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

arturovt
Copy link
Collaborator

Internal functions are moved into a separate package. This will be possible to re-use them when implementing additional packages for @angular/elements and renderComponent.

@@ -9,7 +9,7 @@
"rules": {
"semi": ["error", "always"],
"indent": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/indent": false,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

@joeldenning joeldenning left a comment

Choose a reason for hiding this comment

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

Interesting, so the idea is that the single-spa-angular package would have the ability to mount/unmount an Angular module, Angular component, or Angular element?

Why create separate npm packages for this instead of just separate files within the same package? You can do import 'single-spa-angular/internal' without internal having its own package.json. Is making a separate package.json required for ng-packagr to handle import paths within a package?

@arturovt
Copy link
Collaborator Author

It's not an npm package. In theory, it's called "secondary entry point". Here is very short docs: https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md

So we gonna have a single package single-spa-angular and sub-packages single-spa-angular/{elements,render-component}. Thus people will not bundle the functionality they don't need or use. If the developer wants to bootstrap/mount/unmount only Angular module then he will use single-spa-angular, if he wants to bootstrap an Angular element module that will define custom web component then he will use single-spa-angular/elements and etc.

Everything will be inside single-spa-angular. By creating sub-packages we reduce the tight coupling and add the ability to import only that stuff that you wanna use.

Copy link
Member

@joeldenning joeldenning left a comment

Choose a reason for hiding this comment

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

Looks good to me

@joeldenning joeldenning merged commit 26db039 into single-spa:master Apr 30, 2020
@arturovt arturovt deleted the internals branch April 30, 2020 17:46
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.

None yet

2 participants