ST: rewrite of share component and detect to use the commonjs way.