A new law that is passed doesn’t have retroactive power
A court ruling that the thing you’ve been doing for a year has been breaking an existing law can absolutely punish you for it. But it’s unlikely to punish random individuals doing things on a non noteworthy scale when a clear understanding of the law in a new context has not been established.
At least, at this time, with current interpretation- "the Supreme Court has explained that people must have notice of the possible criminal penalties for their actions at the time they act" [2] (See also Weaver v Graham[3])
This might be subject to change.
[1]https://constitution.congress.gov/browse/essay/artI-S9-C3-3-...
[2]https://constitution.congress.gov/browse/essay/artI-S9-C3-3-...
[3]http://cdn.loc.gov/service/ll/usrep/usrep450/usrep450024/usr...