I'm thinking this too at the moment. I've got terrible morning sickness so want to tell her straight away (I'm only 6 weeks), but equally being considered for a new job as part of a restructure and think it could impact my chances (I'm sure they'd cover it up well enough that I won't be able to prove it though!)
My view generally is 12 weeks is reasonable if you can wait that long and don't need to tell them sooner. I also think its polite to tell the boss before you put it on social media and announce to other colleagues