Heat the oil in a large casserole dish. Season the ribs and fry over a medium-high heat for 3-4 minutes on each side, until browned (you may need to do this in batches, adding a little more oil); set aside.
Fry the shallots for 5 minutes, partially covered, until golden and starting to soften, then add the garlic and ginger and cook for another 2 minutes. Add the star anise, soy sauce and stock, scraping the base of the pan to lift any sticky bits. Bring to the boil, then reduce to a simmer and return the meat to the pan, along with any juices.
Cover and simmer for 3 hours until the meat is very tender. (At this stage you can either leave the meat on the bone or break into chunks with two forks.) Uncover and simmer briskly for another 50-55 minutes, turning the meat occasionally; you should have a rich sauce that coats the meat; if not, reduce further. Season, adding lime juice to taste. Serve scattered with the salad onion and slices of lime, with sticky rice, if liked.