effrenus / yandex-map-react

70 stars 22 forks source link

MarkerLayout not working when module is minified #20

Open gribnoysup opened 8 years ago

gribnoysup commented 8 years ago

When module is minified, this comparison doesn't work because components name is minified as well

switch (component.type.name) {
    case 'MarkerLayout':
        this._setupMarkerLayout(component);
        break;
    case 'BalloonLayout':
        this._setupBalloonLayout(component);
        break;
    default:
        break;
}

I created a PR with possible solution #21

dmitry-sher commented 8 years ago

+1

ghost commented 7 years ago

It would be smarter to use CONSTANTS like

const MARKER_LAYOUT = "MarkerLayout";
switch() {
  case MARKER_LAYOUT: 
  ...
}
gribnoysup commented 7 years ago

@dropfen constants with strings still will not help when file is minified because component displayName is not provided for MarkerLayout and BallonLayout. So there are two options (maybe more, I can come up with only two now):

ghost commented 7 years ago

my point is to use constants instead of all strings ( e.g dislayName: MARKER_LAYOUT etc. )

Am 13.09.16 um 15:54 schrieb Sergey:

@dropfen https://github.com/dropfen constants with strings still will not help when file is minified because component |displayName| is not provided for |MarkerLayout| and |BallonLayout|. So there are two options (maybe more, I can come up with only two now):

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/effrenus/yandex-map-react/issues/20#issuecomment-246688733, or mute the thread https://github.com/notifications/unsubscribe-auth/ACKYhzluog7uMQIiNGD51CuapNWL9Tlyks5qpqsogaJpZM4JZ1wQ.