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

Migrate from Vitreum to Webpack AND/OR other services #3480

Open
5e-Cleric opened this issue May 17, 2024 · 7 comments · May be fixed by #3566
Open

Migrate from Vitreum to Webpack AND/OR other services #3480

5e-Cleric opened this issue May 17, 2024 · 7 comments · May be fixed by #3566
Labels
complicated dependencies Pull requests that update a dependency file Epic

Comments

@5e-Cleric
Copy link
Member

5e-Cleric commented May 17, 2024

Issue

Vitreum has not been maintained for the last 4 years. Since then we have been running using a fork by @calculuschild, but this might prove like an inefficient idea in the long run.

Conversation has started talking about moving from Vitreum to Webpack or another bundling system, this issue is here to log that project's ideas and conversation.

It uses common tools: React, Browserify, and LiveReload. so we might need to install other tools as well.

@5e-Cleric
Copy link
Member Author

#3479 might be related to Vitreum

@5e-Cleric 5e-Cleric added the Epic label May 17, 2024
@calculuschild
Copy link
Member

calculuschild commented May 17, 2024

Vitreum is mostly a wrapper for Browserify, which is the bundler, with some default settings baked in. It also includes Babel (tranform new JS into backwards-compatible JS), and includes watchify, livereload, and nodemon which are the "auto-restart/rebuild" tools. Then it adds a string to the top of the bundle that launches the React app on the client. That's basically it.

  • Browserify is not getting updated much anymore (occasionally hiccups on newer JS), but we could update it to Webpack.
  • Babel should be kept. We have overwritten most of the Vitreum defaults in our buildHomebrewery.js script anyway.
  • Watchify tells Browserify to rebuild when a change is detected. Don't think it works with other bundlers but Webpack should have a similar tool
  • Nodemon should be kept. Lets us auto-restart the server when rebuild happens, for development
  • Livereload no longer works with newer browsers (like Nodemon but for restarting the browser page)

@Gazook89
Copy link
Collaborator

Thanks for clarity on this. Livereload I can live without, but it seems some frameworks still have something similar.

@5e-Cleric
Copy link
Member Author

Can confirm Webpack has a similar thing, but i think i used a diferent command for it in Axe, not sure.

@5e-Cleric 5e-Cleric added the dependencies Pull requests that update a dependency file label May 28, 2024
@G-Ambatte G-Ambatte linked a pull request Jul 9, 2024 that will close this issue
@G-Ambatte
Copy link
Collaborator

G-Ambatte commented Jul 9, 2024

I have done some initial work on migrating Homebrewery to Browserify et al directly, in order to eliminate the technical debt that is Vitreum.

My working theory is that once we can plainly see how Browserify et al are actually being used by Homebrewery, then we can start to investigate and learn how to migrate from them to other tools, using the guides and articles on the internet at large that we would struggle to find if we were still trapped behind the obfuscation layer that is Vitreum.


To be clear, this is VERY much a learning experience for me, I'm figuring it out as I go and hopefully not unintentionally breaking anything. So if you know why something is the way that it is, or you know of a better way to achieve the goal, please don't hesitate to speak up.

@G-Ambatte
Copy link
Collaborator

Breaking it down, to the best of my knowledge, Vitreum has been providing the following functions to Homebrewery:

  • headTags.js - provides the Meta React component. Not sure if there's a reason that this should live in the bundler rather than the codebase directly.
  • transforms/asset.js - a wrapper for an async file copy function
  • transforms/less.js - a wrapper for less.render
  • transforms/pack.js - a wrapper for browserify

At this point in time, I have commented out watchFile and liveReload as Dev only tools.

@G-Ambatte
Copy link
Collaborator

G-Ambatte commented Jul 9, 2024

I had not previously realized that we now have two systems for injecting Meta tags. So there exists the opportunity to standardize to a single Meta tag system. The Vitreum Meta tag is used on the Share and Edit pages to add <Meta name='robots' content='noindex, nofollow' />, and on the Home page to add <Meta name='google-site-verification' content='[content_redacted]' />.

In theory, at least, the ogMeta tag system used in app.js could be extended to incorporate these additional tags; alternatively, the ogMeta tags could be shifted to use the existing <Meta> React components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complicated dependencies Pull requests that update a dependency file Epic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants