We announced very early. I'm not even 5 weeks yet. I was very torn about it, but ultimately this is what we did:
Our family (who is spread across the US and a chunk in Europe temporarily) didn't know we were trying, so it was very exciting to share the news. We are much closer with my husband's family and I want them to know and love the newest member of the family, even if he or she goes to heaven before we get to meet. They are all very loving and supportive, so I have no hesitations about sharing sad news later on.
My family, on the other hand, is not as close with us. They are very nice, and would be supportive, but I feel uncomfortable being vulnerable with them. I told my mom through text message and haven't yet told my dad. I may wait until I have a scan to share the news with him. He is so sweet, but awkward, so it will be easier on me in the event of a loss to not have to call and break his heart.
We have told our close friends, and others within earshot. Those who knew we were trying are in the loop. We don't really do social media, so all news has been shared personally and directly. All who know are aware that we aren't broadcasting the news, as we've asked that they keep it to themselves until we are ready.
I'm not sure, if I have a loss, what we would do moving forward in terms of announcing.
I think it depends completely on what you are comfortable with! Good luck!