Modern aircraft are generally of monocoque construction. Does this apply only to the fuselage, or are modern wings made without load bearing ribs as well? Are they just for shaping of the metal skin?
Modern transport category aircraft utilise a semi-monocoque construction. Best to check the FAA Maintenance Handbook Vol. 1, chapter 1 . Basically, both an internal frame and the skin share the load, unlike the older truss-type, where only the frame carried the load, or in a monocoque type where effectively just the "skin" carries the load.
This is even true in a modern composite wing like that of the A350. Here there are metallic ribs, carrying some of the load, with a composite skin . Here is an image of those ribs and the wing structure, and if you check the presentation, you can see the composite skin on the next slide.
: FAA. (2018). Aviation Maintenance Technician Handbook - Airframe Volume 1. Federal Aviation Administration. https://www.faa.gov/sites/faa.gov/files/regulations_policies/handbooks_manuals/aviation/amt_airframe_hb_vol_1.pdf
: Fualdes, C. (2016, 25-30 Sep.). Experience and lessons learned of a Composite Aircraft. [Conference Presentation] 30th Congress of the International Council of the Aeronautical Sciences ICAS, Daejeon, Korea. https://www.icas.org/media/pdf/ICAS%20Congress%20General%20Lectures/2016/2016%20Composite%20Aircraft%20Fualdes.pdf
Your question contains the answer ;-)
Since ribs have the really important job of preserving the aerodynamic shape of the wing, it follows that they are stressed. They are actually so stressed that in some design they look more like a truss then a thin layer of aluminium, see for example this cutaway of the Concorde:
Ribs are also used to introduce big loads in the structure: engine's pylons are attached to ribs; external weapons or storages are attached to ribs (these attachments are called hard-points); the hinges of flaps, slats and control surfaces are also attached to ribs.
Ribs are also used to delimit fuel tanks.
Somehow you need to carry the lift chordwise to the spar, where it is needed to keep the fuselage up in the air. Doing this with a rib is structurally much more efficient than beefing up the skin to do this without ribs. Also, flap, gear and engine loads will need ribs because the wing skin by itself would buckle and fail from those concentrated loads.
Even lightly loaded wings like those of composite gliders use ribs in their wings, albeit only a few. One at the root is needed to carry the lift loads from the lift pins to the spar, others to keep the water ballast tanks in place (or to form the water ballast tank in a "wet" wing).