component-party.dev icon indicating copy to clipboard operation
component-party.dev copied to clipboard

feat(angular): update the existing files + add the new angular (renaissance) practices

Open LcsGa opened this issue 1 year ago β€’ 3 comments

Solves the issue #241

LcsGa avatar Jul 20 '24 22:07 LcsGa

The build is failing, can you fix it ? As I said it's surely because of a change in frameworks.mjs

matschik avatar Jul 24 '24 13:07 matschik

I can take another look at it tomorrow but I couldn't find what was the issue there

LcsGa avatar Jul 24 '24 21:07 LcsGa

Well, I took a look at the code of the .mjs file but I really don't see what could break there... I'm not really familiar with this kind of config files too so I may be missing something but I can't figure out what πŸ˜…

LcsGa avatar Jul 24 '24 21:07 LcsGa

Can anyone tell what status of this PR is? Are there any issues?

ogix avatar Oct 23 '24 13:10 ogix

The status of this PR remains unchanged. I still have the same issues that the ones above and didn't have the time (and probably the knowledge) to fix them.

If you have any ideas to resolve them, I'd be glad to try them

LcsGa avatar Oct 24 '24 10:10 LcsGa

Ok, thanks. Maybe I will have a look if I find time for this.

BTW, Angular 19 is making components "standalone: true" by default, so we can remove later those flags.

ogix avatar Oct 24 '24 10:10 ogix

@LcsGa You introduce a bug and I have to solve it ? That's a little unfair. To make it fair, can you at least give me some steps to reproduce and error logs ? I'll try to fix it afterwards.

matschik avatar Oct 24 '24 11:10 matschik

@LcsGa You introduce a bug and I have to solve it ? That's a little unfair. To make it fair, can you at least give me some steps to reproduce and error logs ? I'll try to fix it afterwards.

I never told you that you had to solve it yourself.

I'm not familiar with the way of doing in the framework.mjs file... I first simply tried to copy/paste + update the angular config into angular-renaissance. Then I did what was written in the readme with the problem you told me it probably was but none of it worked and I'm running out of ideas...

I don't clearly remember how to reproduce it righ now + I changed my computer but I will soon clone it once more, retry, and give more informations if :

  • I still cand find any fix myself
  • I have more to provide

The most that I remember at the moment is that I simply tried to build the projects with the provided commands but it failed right away

LcsGa avatar Oct 24 '24 11:10 LcsGa

Can you give the error logs to begin the investigation ?

matschik avatar Oct 24 '24 12:10 matschik

I didn't have the opportunity to retry yet but the error I faced was:

pnpm run dev

> [email protected] dev /home/lucas/dev/component-party.dev
> vite

[generateFrameworkContent] Generating framework content files...
TypeError: Cannot read properties of undefined (reading 'push')
    at file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2843:40
    at async Promise.all (index 4)
    at async generateContent (file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2831:7)
    at async build (file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2981:7)
    at async PluginContext.buildStart (file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2997:9)
    at async Promise.all (index 6)
    at async PluginContainer.hookParallel (file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:49481:5)
    at async PluginContainer.buildStart (file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:49484:5)
    at async file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:63425:7
    at async httpServer.listen (file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:63440:9)
error when starting dev server:
TypeError: Cannot read properties of undefined (reading 'push')
    at file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2843:40
    at async Promise.all (index 4)
    at async generateContent (file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2831:7)
    at async build (file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2981:7)
    at async PluginContext.buildStart (file:///home/lucas/dev/component-party.dev/vite.config.js.timestamp-1721509708644-d2f6b8691061.mjs:2997:9)
    at async Promise.all (index 6)
    at async PluginContainer.hookParallel (file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:49481:5)
    at async PluginContainer.buildStart (file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:49484:5)
    at async file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:63425:7
    at async httpServer.listen (file:///home/lucas/dev/component-party.dev/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:63440:9)
 ELIFECYCLE  Command failed with exit code 1.

LcsGa avatar Oct 25 '24 07:10 LcsGa

@LcsGa I found the problem. In frameworks.mjs, you declared Angular Renaissance framework with id "angularRenaissance". But in content directory, you used "angular-renaissance" instead of the id "angularRenaissance".

See "emberOctane" for example

matschik avatar Oct 25 '24 16:10 matschik

@LcsGa Why did you declare in Angular examples "AppModule" with "@NgModule" and not in Angular Renaissance ? I think it's not necessary since it's just to learn about the syntax.

Let's make it @LcsGa ! Your branch is working now :) Can you apply previously suggested modifications by @ogix ?

matschik avatar Oct 25 '24 16:10 matschik

@LcsGa I found the problem. In frameworks.mjs, you declared Angular Renaissance framework with id "angularRenaissance". But in content directory, you used "angular-renaissance" instead of the id "angularRenaissance".

See "emberOctane" for example

Oh my... I really didn't notice that... The most time consuming bugs are always the most stupid ones I guess...

LcsGa avatar Oct 25 '24 18:10 LcsGa

@LcsGa Why did you declare in Angular examples "AppModule" with "@NgModule" and not in Angular Renaissance ? I think it's not necessary since it's just to learn about the syntax.

Let's make it @LcsGa ! Your branch is working now :) Can you apply previously suggested modifications by @ogix ?

I added the modules on purpose! Before angular v14 that was mandatory to create components. If I wanted to highlight how it improved and truly compare the two of them, I had to add them in v13- In angular renaissance, you simply have the standalone property in the @Component and it will even be true by default in one month!

Yeah sure! I can do that tomorrow morning I think! 😁

LcsGa avatar Oct 25 '24 18:10 LcsGa

Why have the 3-router-link and the 4-routing been removed here? That is not deprecated

They have been removed from other frameworks.

matschik avatar Oct 25 '24 22:10 matschik

Why have the 3-router-link and the 4-routing been removed here? That is not deprecated

They have been removed from other frameworks.

Oh okay, makes sense! That's an angular loss though. It is a good argument, favouring angular against the other tools since it's directly included in it.

LcsGa avatar Oct 27 '24 00:10 LcsGa

I understand but the cost would be too much on other frameworks since there are endless ways to do routing. Yes that's a good point for Angular.

matschik avatar Oct 27 '24 12:10 matschik

Ok let's merge it ! Let's iterate if changes are needed !

matschik avatar Oct 27 '24 12:10 matschik

Great! And yes, there will be some new improvements soon (2/3 weeks) πŸ˜‰

LcsGa avatar Oct 27 '24 14:10 LcsGa