PrestaShop / TopTranslators

Top translators tribute page
https://translators.prestashop-project.org/
0 stars 3 forks source link

Modernize stack and convert to vue+vite #68

Closed davidglezz closed 9 months ago

davidglezz commented 10 months ago
Questions Answers
Description? There are a lot of outdated deps. This PR migrates from webpack 1 to vite and from React+jQuery to Vue.
Type? refactor
BC breaks? yes
Deprecations? n/a
Fixed ticket? Fixes #65
Sponsor company
How to test? Manual compare with https://translators.prestashop-project.org/

Why change to Vite and Vue instead of fixing the dependency problem that existed?

Really old libraries were used, Webpack 1 and a lot of loaders. Due to the breaking changes of new versions of webpack and loaders, it would take me more time than just starting a vue project and migrating a dozen components.

kpodemski commented 10 months ago

wow @davidglezz !

davidglezz commented 10 months ago

Thanks This week I am without laptop because si am on vacations. See you next week 😁

matks commented 10 months ago

Before I can test this PR I need to install Node.js 20 on my laptop without breaking my stack 😅 might take a few time

davidglezz commented 9 months ago

@matks

Question: don't you think that even Vue or Vite are over-engineered for this site?

Probably yes, a bit, Vue is mainly used as template engine and is the easiest path (for me) to migrate from old react codebase.

Converting to framework-less will require more effort IMO.

davidglezz commented 9 months ago

I see other issues:

matks commented 9 months ago

Oh yeah there are a loooooot of issues with this repository 😛

mflasquin commented 9 months ago

Before I can test this PR I need to install Node.js 20 on my laptop without breaking my stack 😅 might take a few time

https://github.com/nvm-sh/nvm 😉

matks commented 9 months ago

And here we go 😄 troubleshooting brew updates dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.72.dylib

EDIT: argh 😭 so many deps to update

matks commented 9 months ago

For the record I broke my php + node setup on my laptop 😛 when trying to install Node 20. This is because of https://www.skymac.org/Admin-Dev/article-5038c427-Homebrew-Corriger-un-probleme-de-dependances-trop-recentes.htm

I think I will reinstall my laptop from zero 😄 too many piles of software on it and now it all crumbled.

davidglezz commented 9 months ago

@matks I'm glad you renewed the node setup successfully.

You can do npm run dev (dev build) or npm run build && npm run preview (to preview production build - recommended) or npm run build and serve with other tool the ../public (not front/index.html)

And thank you very much for taking the time to review my PR.

davidglezz commented 9 months ago

There are things that are a bit ugly, but that's because I did this in a few hours, I didn't want to spend more time doing some refactoring or improvements without being sure that I'm on the right track and knowing that it could be merge.

Feel free to request any changes or ask me anything you want.

Have a nice day =)

matks commented 9 months ago

@matks I'm glad you renewed the node setup successfully.

You can do npm run dev (dev build) or npm run build && npm run preview (to preview production build - recommended) or npm run build and serve with other tool the ../public (not front/index.html)

And thank you very much for taking the time to review my PR.

I did npm run build and serve with other tool the ../public because if I am not wrong this is what the real env will look like.

It works on my machine 🎉 so I think code is "good enough" for now 😄 . This PR is already big, improvements should be done in other PRs.

Now how do we plug this into existing GitHub Action pipeline and test it?

What we could do is create a new branch on this repository, a branch refacto, and push updated workflow on this branch. I think I can configure GitHub to build the refacto branch on a Environment, allowing us to verify the result. Wdyt?

davidglezz commented 9 months ago

I think it's great!

matks commented 9 months ago

Branch refacto is created. Let's merge this PR into refacto and then I will build a test environment for GitHub Actions from refacto. I also added the hacktoberfest label to the repository 😉 so if you participate in Hacktoberfest this PR will be eligible

matks commented 9 months ago

Env configured https://github.com/PrestaShop/TopTranslators/commit/325ec08c4fe968c645ff60c0522bc07e3b913428

matks commented 9 months ago

Let's see if it works https://github.com/PrestaShop/TopTranslators/pull/70

matks commented 9 months ago

Everything looks good -> https://github.com/PrestaShop/TopTranslators/pull/71 PR to deploy it to prod

If OK for you @davidglezz then tomorrow we can deploy in production

davidglezz commented 9 months ago

Perfect!

matks commented 9 months ago

@davidglezz Your changes are live.

If you're motivated, there are warnings & notices in the logs https://github.com/PrestaShop/TopTranslators/actions/runs/6571132956/job/17849715207#step:12:1