-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit updates angular-prerender to work with Angular v17. It also removes everything related to the now deprecated @nguniversal package. BREAKING CHANGE: Using Angular v16 and or any package from the @nguniversal scope is not supported any longer.
- Loading branch information
1 parent
bcabb09
commit a46bc8b
Showing
16 changed files
with
115 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import { IMainExports } from '../interfaces'; | ||
import type { StaticProvider } from '@angular/core'; | ||
import { isModule } from '../guards/module.js'; | ||
import { IMainExports, IRenderUtilsExports } from '../interfaces'; | ||
import { TRenderApplicationFunction } from '../types'; | ||
|
||
export const bindRenderFunction = async (main: string) => { | ||
const { | ||
default: { AppServerModule, renderModule } | ||
} = <{ default: IMainExports }>await import(main); | ||
export const bindRenderFunction = async (main: string, renderUtils: string) => { | ||
const { default: bootstrapOrModule } = <IMainExports>await import(main); | ||
const { renderApplication, renderModule } = <IRenderUtilsExports>await import(renderUtils); | ||
|
||
return renderModule.bind(null, AppServerModule); | ||
if (isModule(bootstrapOrModule)) { | ||
return ({ document, platformProviders, url }: Parameters<TRenderApplicationFunction>[1]) => | ||
renderModule(bootstrapOrModule, { document, extraProviders: <undefined | StaticProvider[]>platformProviders, url }); | ||
} | ||
|
||
return renderApplication.bind(null, bootstrapOrModule); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.