Skip to content

feat: new example, helia-angular #308

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

Open
SgtPooki opened this issue Aug 8, 2024 · 9 comments
Open

feat: new example, helia-angular #308

SgtPooki opened this issue Aug 8, 2024 · 9 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@SgtPooki
Copy link
Contributor

SgtPooki commented Aug 8, 2024

To help some Angular devs who want to use Helia, it would be great if we had an example showing a basic Helia example using Angular framework.

To create: re-use an existing example and just modify to use Angular instead.

@SgtPooki SgtPooki added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 8, 2024
@paschal533
Copy link

@SgtPooki I will work on this tonight :)

@Nkovaturient
Copy link

Hello there!
I would like to work on this issue if its still open? Kindly update. 😊

@paschal533
Copy link

Hello there! I would like to work on this issue if its still open? Kindly update. 😊

Yeah, sure. Let's work on it together. I have created a PR (#309) but some test keeps failing when you run ng test. Thank you for your help. 😊

@Nkovaturient
Copy link

Hello there! I would like to work on this issue if its still open? Kindly update. 😊

Yeah, sure. Let's work on it together. I have created a PR (#309) but some test keeps failing when you run ng test. Thank you for your help. 😊

Integrating Helia-angular with SSR by intuitively wrapping ngOnInit and isPlatformBrowser was indeed a bold move, however the missing outerHTML setting test seems to be a obstacle.

Thanks for the response, I shall get back to you with my update.

@paschal533
Copy link

Hello there! I would like to work on this issue if its still open? Kindly update. 😊

Yeah, sure. Let's work on it together. I have created a PR (#309) but some test keeps failing when you run ng test. Thank you for your help. 😊

Integrating Helia-angular with SSR by intuitively wrapping ngOnInit and isPlatformBrowser was indeed a bold move, however the missing outerHTML setting test seems to be a obstacle.

Thanks for the response, I shall get back to you with my update.

Thanks :)
I will be waiting for your update.

@Nkovaturient
Copy link

Hey @paschal533 ,
As concluded, Its working perfectly fine in angular-csr. However, facing this err constantly with angular-ssr enabled--

Error: Cannot find module '../../package.json'
Require stack:
- F:\Helia\helia-examples\examples\helia-angular\.angular\prerender-root\d591a9ff-9627-423e-b15b-8419393814b8\main.server.mjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at file:///F:/Helia/helia-examples/examples/helia-angular/.angular/prerender-root/d591a9ff-9627-423e-b15b-8419393814b8/main.server.mjs:219:8007
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at async extractRoutes (F:\Helia\helia-examples\examples\helia-angular\node_modules\@angular\build\src\utils\server-rendering\routes-extractor-worker.js:23:83)
    at async F:\Helia\helia-examples\node_modules\piscina\dist\worker.js:144:26


npm ERR! Lifecycle script `build` failed with error: 
npm ERR! Error: command failed
npm ERR!   in workspace: [email protected]
npm ERR!   at location: F:\Helia\helia-examples\examples\helia-angular


Troubleshoot/debugging fixes taken by me so far--

  1. Webpack plugin---- since Angular bundles modules, and the relative path structure is lost, using a Webpack Plugin to Inline the package.json
  2. Include package.json in SSR Build--- modifying angular.json to include helia as commonjs dependency--```
    "build": {
    "options": {
    "allowedCommonJsDependencies": [
    "helia"
    ]
    }
    }

Any guidance?

@SgtPooki
Copy link
Contributor Author

FYI Helia should be fully ESM afaik...

@Nkovaturient
Copy link

@SgtPooki @paschal533 kindly look into it,

#425

I have arduously fixed, modified and debugged err and setup helia-angular. 🙂

@paschal533
Copy link

@SgtPooki @paschal533 kindly look into it,

#425

I have arduously fixed, modified and debugged err and setup helia-angular. 🙂

Well done 🎉, Neha. I will review it in a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants