JesseSkinner,
@JesseSkinner@toot.cafe avatar

Migrating from CodeIgniter to is so easy and pleasant.

By building the site 15 years ago, and modernizing it today, I skipped over the awkward middle stage of making an API & fetching data to render it in the browser.

SvelteKit's form actions let you build a fast site that even works without , which means I'm going from server-side rendering with links & forms, to server-side rendering with links & forms. Except now I have the power of to make it way nicer!

ramsey,
@ramsey@phpc.social avatar

@JesseSkinner How does a migration like that work? What made it easy and pleasant?

JesseSkinner,
@JesseSkinner@toot.cafe avatar

@ramsey I love how everything has a 1:1 mapping.

So my CodeIgniter views become Svelte templates. I go through each one and replace eg <? foreach ($list as $item): ?> to { list as item} etc. which is surprisingly straightforward.

Then, the CI models & libraries I copy to $lib/server, keep all the function structure and SQL the same, and just migrate PHP syntax to JavaScript.

Each route function in the CI controllers ends up mapping to a +page.server.js load function in each route.

matthiou,
@matthiou@mastodon.social avatar

@JesseSkinner @ramsey Have you found an automated & reliable tool to migrate from PHP to JS syntax ? The very few I had tested were terrible

JesseSkinner,
@JesseSkinner@toot.cafe avatar

@matthiou hm, interesting idea. I haven't looked for one. I'm just doing it by hand.

ramsey,
@ramsey@phpc.social avatar

@JesseSkinner @matthiou Sounds more like a rewrite than a migration. 😉

JesseSkinner,
@JesseSkinner@toot.cafe avatar

@ramsey I guess, but it's more like a translation.
@matthiou

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • DreamBathrooms
  • magazineikmin
  • thenastyranch
  • InstantRegret
  • ngwrru68w68
  • Youngstown
  • Durango
  • slotface
  • mdbf
  • rosin
  • cisconetworking
  • kavyap
  • modclub
  • everett
  • megavids
  • khanakhh
  • ethstaker
  • tacticalgear
  • vwfavf
  • GTA5RPClips
  • anitta
  • Leos
  • osvaldo12
  • cubers
  • normalnudes
  • provamag3
  • tester
  • JUstTest
  • All magazines