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

[Spike] Exploratory work to standardize build systems #750

Closed
jpellizzari opened this issue May 11, 2022 · 11 comments
Closed

[Spike] Exploratory work to standardize build systems #750

jpellizzari opened this issue May 11, 2022 · 11 comments
Assignees
Labels

Comments

@jpellizzari
Copy link

The different build systems of EE and wego core are causing an irreconcilable problem where Core builds are slow because of the image-inline-ing directive that webpack needs:

weaveworks/weave-gitops#1916

We should investigate the work involved to standardize build systems. We can stick with parcel or move to esbuild or some other flavor-of-the-month JS build system.

@jpellizzari
Copy link
Author

Also, while we are at it, lets standardize on yarn as well. We already use it on both EE and the docs website. I had originally chosen npm as it is easier to adopt, but it turns out we were already using yarn everywhere.

@ahussein3
Copy link
Contributor

what about going CreateReactApp so that we have standard between both projects dependency as well ? what do you think @jpellizzari ?

@foot
Copy link
Collaborator

foot commented May 12, 2022

In the context of being able to import core w/ svgs..

Vite

I tested out vite while looking at esm modules as a fix for weaveworks/weave-gitops#1917

Out of the box it was able to handle esm + images in the production build but dev server didn't copy them across to the dev hosted assets properly. I meant to see if that was a config option somewhere.

Vite is very fast (like, the HMR updates faster than you can cmd-tab back to the browser), uses esbuild under the hood.

Vite poc on EE from a little bit ago:

Parcel

I haven't been able to get the svg -> component thing working, it seems to be broken for now =/ parcel-bundler/parcel#6688

So if we drop svgr this should work.

CRA

Out of the box I can't figure out how to load svgs from another module.

weaveworks/weave-gitops#1917 (comment)

We might be able to eject to make this work w/ craco and more webpack conf.

@jpellizzari
Copy link
Author

what about going CreateReactApp so that we have standard between both projects dependency as well ? what do you think @jpellizzari ?

In my experience CreateReactApp, adds a lot of unnecessary cruft and magic that does more harm that good, as it abstracts the underlying webpack stuff. Our current situation is a perfect example of that.

@ahussein3
Copy link
Contributor

@jpellizzari I though our current situation because we have two different build system. is there a ticket or something explaining what is the situation exactly ?

@jpellizzari
Copy link
Author

@ahussein3 You are correct, but we cannot resolve the situation because our webpack config is hidden by CRA

@foot
Copy link
Collaborator

foot commented May 12, 2022

is there a ticket or something explaining what is the situation exactly ?

This guy! weaveworks/weave-gitops#1916

Which is roughly: we want to publish weave-gitops core as a node module of components, some of those components use svg images.

We haven't figured out how to bundle svg images in a node module nicely. Our solution right now is to inline the svg data, this is not great.

@mnowster
Copy link
Contributor

tagging @ozamosi for visibility, if we unify on package manager etc this will be changes in core 👍🏻

thanks @jpellizzari for this spike ✨

@ahussein3
Copy link
Contributor

@jpellizzari we can eject and manage the config files ourselves but that is one way to go.

@jpellizzari
Copy link
Author

jpellizzari commented May 12, 2022

@foot I added some commits and rebased main on your vite PoC branch and it looks to be working with the normal url: directives in core (tested locally):

#755

Would you mind pulling it down and testing?

@jpellizzari
Copy link
Author

Results of the spike are:

#755
weaveworks/weave-gitops#2163

Closing the spike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants