enonic / starter-react4xp

React4xp starter with examples, for Enonic XP7
Other
4 stars 1 forks source link

Put react4xp sources under assets #11

Closed ComLock closed 4 years ago

ComLock commented 5 years ago

I notice (which has also been documented) that react4xp sources are compiles to build/resources/main/assets/react4xp but the sources are not located under src/main/resources/assets/react4xp but rather src/main/resources/react4xp.

Why is this?

If it's only to make the build scripts simple perhaps it should be remedied to keep the project structure as similar as possible to other Enonic XP projects.

espen42 commented 5 years ago

No, it's because the react4xp flow before and during compiling is pretty different from the way stuff happens in native XP. They aren't just assets, because the compilation process automates a few things that need to be done for the react4xp files and only those. Mixing them up with other assets runs the risk of other non-react4xp asset-handling messing up the necessary react4xp flow. I think it's worthwhile to keep them apart.

After compiling, they are basically just assets (although the service make a couple of optimizations).

ComLock commented 5 years ago

:) I interpret that answer to mean: Yes, to make build scripts simple :)

espen42 commented 5 years ago

Hehe, yes, to make build scripts simple, and also no, I don't think its easy to remedy / I don't see a good way to make the pre-compilation project structure more similar than this. :)

espen42 commented 4 years ago

Collecting general-architecture issues in one repo, lib-react4xp. This one is moved to https://github.com/enonic/lib-react4xp/issues/21