twemoji icon indicating copy to clipboard operation
twemoji copied to clipboard

Maxcdn has shut down, cdn not working anymore.

Open simplexx opened this issue 3 years ago • 54 comments

Is there an alternative cdn? Max cdn has shut down and https://twemoji.maxcdn.com/v/latest/twemoji.min.js is down as well.


@WebReflection amend

User-land Solution

https://github.com/twitter/twemoji/issues/580#issuecomment-1376299586

twemoji.parse(
  document.body,
  { base: 'https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/' }
)

What is going on?

MaxCDN doesn't exist anymore and we had it hard coded as default option but that was never meant to be the only CDN able to serve twemoji so that you can simply specify a base field as option to parse with a different CDN or wait for the new package to be deployed on npm and use the new hard coded default. The lesson to learn here is that some CDN might not be there forever, so it's always good to know there are escape hatches within the code, like it is for twemoji.

simplexx avatar Jan 09 '23 15:01 simplexx

sweating-nervous

Xstoudi avatar Jan 09 '23 15:01 Xstoudi

this-is-fine-its-fine

Axsag avatar Jan 09 '23 15:01 Axsag

ElMehdiBouamama avatar Jan 09 '23 16:01 ElMehdiBouamama

There is alternative CDNs, for example: https://unpkg.com/browse/[email protected]/ The problem right now is that it doesn't ship the icons and MaxCDN is basically hardcoded: loFIfOJU06

Xstoudi avatar Jan 09 '23 16:01 Xstoudi

Here is an alternative CDN for twemojis: https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/1f1e6-1f1fd.png

ElMehdiBouamama avatar Jan 09 '23 16:01 ElMehdiBouamama

there is no js file there though, only images..

Here is an alternative CDN for twemojis: https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/1f1e6-1f1fd.png

simplexx avatar Jan 09 '23 16:01 simplexx

there is no js file there though, only images..

Here is an alternative CDN for twemojis: https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/1f1e6-1f1fd.png

True that

ElMehdiBouamama avatar Jan 09 '23 16:01 ElMehdiBouamama

Uhoh the world is ending!!

Eejit43 avatar Jan 09 '23 16:01 Eejit43

I'm gonna make a PR. The images doesn't need to be on the same CDN. If https://unpkg.com/browse/[email protected]/ uses cloudflare url.

Xstoudi avatar Jan 09 '23 16:01 Xstoudi

As a quick fix i took twemoji-parser and manually changed the index.js code where it directs to max.cdn to the new cdn. This is a very fast fix if your code is in production

ElMehdiBouamama avatar Jan 09 '23 16:01 ElMehdiBouamama

ezgif-3-261ea64e9f

JosephShepin avatar Jan 09 '23 16:01 JosephShepin

elon-musk-smoke

simplexx avatar Jan 09 '23 16:01 simplexx

As a quick fix i took twemoji-parser and manually changed the index.js code where it directs to max.cdn to the new cdn. This is a very fast fix if your code is in production

I can assure you my code hasn't changed in 7 years so if you keep license around, as you should, and just update the static parts to point at a different path, everything should work as expected.

the related PR already addressed this, so fork away and live happily ever after.

WebReflection avatar Jan 09 '23 16:01 WebReflection

@simplexx among all the things, twemoji has always been a Twitter service for the community.

At my times in there, we had a great agreement / deal with MaxCDN so that it's hard to blame the boss this time, as MaxCDN is a completely different company/story.

What I see is some poor attention to this project, as companies don't close from a day to another (usually?) but as we all know what's going on @ twitter, I can't really blame any of my former colleagues, or new arrivals there.

Please let's not make it a wall of shame for all the people that worked on this, thanks for your understanding (I've left 7 years ago or more, as example, I've got pinged by some follower and I'm just trying to help you out anyway).

WebReflection avatar Jan 09 '23 16:01 WebReflection

For what it's worth, while I was still there we were in talks with MaxCDN to have the same deal when they migrated to be Stackpath. Everyone who had worked on the deal with MaxCDN had left and left no record of that deal, so it was taking them a bit longer to work out than expected – MaxCDN used to offer free hosting to OSS projects, but Stackpath wouldn't be doing that. They were working on an exception for us, but any emails they send to our Twitter emails now get bounced, so I guess they could've gotten this sorted out before shutting down MaxCDN... but it's not like we're there on the other end to make it happen, so it appears we'll never know.

jdecked avatar Jan 09 '23 16:01 jdecked

@jdecked apologies for saying "poor attention" then, it looks like Twitter has no fault beside circumstances that made that attention poor (can I say "poor handover" then?). Anyway, I'd be happy to help out keeping this project alive, except its RegExp came from another repository which I've no idea if it's still working/going or not + it needs assets attention which I am not sure it's sill the case.

There's no shame in making this deprecated or dead neither though, I know there are alternatives and yet, it'd be a sad story to tell (imho).

WebReflection avatar Jan 09 '23 17:01 WebReflection

Yeah, we didn't exactly get a chance to hand anything over before getting laid off. Usually a company with the ability to plan business operations would allot time for that, but we all got spontaneously locked out of our computers in the middle of the night, so. Poor handover would imply having tried to hand over. 🥲

The regex comes from https://github.com/twitter/twemoji-parser, where I open sourced the Scala generator for the regex last year so we aren't missing anything there. It also has the same problem of the default options being broken due to MaxCDN, but specifying another path is possible as an option. Assets are kept only in twemoji not twemoji-parser. For longer term maintenance beyond just this one issue, we'd eventually need to fork twemoji-parser too for regex updates – I have NPM publish access to it, but there actually seems to be nobody left with GitHub write access who previously committed to it.

I'd be pretty sad to deprecate Twemoji honestly, especially when the designer is willing to work on a fork of it with me. I was hoping to get wherever I worked next to adopt Twemoji though, so the details are a little up in the air. Maybe we just fork now for compatibility but without substantial support, although I know that would annoy some people.

jdecked avatar Jan 09 '23 17:01 jdecked

@WebReflection @jdecked I had posted in the PR but will add it here. My business partner and I discussed and our company would be potentially interested in keeping it going either on a fork or a completely new repository. We using it a ton at our company and replacing it would actually be more of a pain than maintaining/improving it.

burgoyn1 avatar Jan 09 '23 18:01 burgoyn1

Yosh, First things first: sorry for the annoyance and ten thousands thanks to ex-employees for the fast reaction. For me Twemoji is part of the internet furniture and I definitely would like to see it continuing it's existence.

I hope #581 can end up merged and deployed to put ducktape on the leak, but I don't consider this as a long-term solution and it will be a pleasure to help if a fork emerges.

@jdecked I definitely think it's better to fork even without substantial support to ensure compatibility and let the door of "yeah today I have some time let review a PR or fix an issue" open. Having people that already worked on it and even the designer would give a realy chance to the fork to live and having people that want to see it live like @burgoyn1 or me could discharge the "owners" of some of the annoying work.

Xstoudi avatar Jan 09 '23 18:01 Xstoudi

https://github.com/twitter/twemoji/issues/580#issuecomment-1375874400 Here is an alternative CDN for twemojis: https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/1f1e6-1f1fd.png

it's worked for me

rlocatelli9 avatar Jan 09 '23 18:01 rlocatelli9

If you don't want to use a fork, this was my hot fix in the one place we used twemoji:

result = twemoji.parse(segment.text, {
  folder: 'svg',
  ext: '.svg',
});
// temporary fix because maxcdn has stopped supporting twemoji
return result.replace(
  'twemoji.maxcdn.com/v',
  'cdnjs.cloudflare.com/ajax/libs/twemoji',
);

karptonite avatar Jan 09 '23 19:01 karptonite

Consider switching to jsDelivr https://www.jsdelivr.com/package/npm/twemoji

How to use https://github.com/twitter/twemoji/issues/580#issuecomment-1376299586

We also host Bootstrap CDN.

jimaek avatar Jan 09 '23 20:01 jimaek

Consider switching to jsDelivr https://www.jsdelivr.com/package/npm/twemoji We also host Bootstrap CDN.

The problem is the images/svg still point to maxcdn.com. Those images are not on jsdeliver.

burgoyn1 avatar Jan 09 '23 20:01 burgoyn1

If someone who controls the domain is reading then please get in contact cause we can provide a custom CDN to get all sites back online

jimaek avatar Jan 09 '23 20:01 jimaek

@jimaek after pointing to https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.7/assets/svg/1f44d.svg emojis are loading fine, do you have any other custom CDN path?

sajus avatar Jan 09 '23 20:01 sajus

FYI how to use jsDelivr to serve twemoji images:

twemoji.parse(
  document.body,
  { base: 'https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/' }
)

yhatt avatar Jan 09 '23 20:01 yhatt

@jdecked I believe what's next, as I've merged into master the CDN change, is to actually run npm run deploy or basically bring the dist folder into gh-pages branch, and then publish from there to npm ... this should just bring in latest .js files with the different CDN, and upload the new package that should work out of the box. Dare I say, as this is currently fully broken for everyone, a patch version might be what everyone would hope for, but then again, history told us sneaky patches are bad, so at least a minor, if not a major, would be needed, imho ... but I let you decide on that.

WebReflection avatar Jan 09 '23 21:01 WebReflection

@yhatt yes, the library is meant to run even on localhost, so that changing the base field should always work (it does on my machine 😅) however, the default is a broken CDN, and I think this should be fixed.

I don't think I can deploy to npm but if @jdecked somehow has issues in porting master/dist to gh-pages branch and publish from it, which is basically what deploy.sh does, I can try and eventually fail at publishing time.

WebReflection avatar Jan 09 '23 21:01 WebReflection

For everyone else looking for the quick and dirty summary fix:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/twemoji.min.js"></script>
<script>
  twemoji.parse(document.body, { base: 'https://cdn.jsdelivr.net/gh/twitter/[email protected]/assets/' });
 </script>

zeevl avatar Jan 09 '23 22:01 zeevl

unpkg only hosts JavaScript files (https://unpkg.com/browse/[email protected]/), and cdnjs only hosts emoji images (https://cdnjs.com/libraries/twemoji). jsDelivr can host both, by using npm entrypoint and github entrypoint.

https://cdn.jsdelivr.net/npm/[email protected]/dist/twemoji.min.js

yhatt avatar Jan 09 '23 23:01 yhatt