remix icon indicating copy to clipboard operation
remix copied to clipboard

Upgrade `isbot` (again)

Open pwbriggs opened this issue 1 year ago • 6 comments

Reproduction

isbot came out with another major version, 5. It doesn't look like much of a difference from 4, so I imagine it wouldn't be too difficult a fix (but I'm not familiar with how Remix works internally).

System Info

N/A

Used Package Manager

npm

Expected Behavior

Remix dev server should install isbot ^5 when initializing a new project.

Actual Behavior

It installs isbot ^4.

pwbriggs avatar Feb 21 '24 18:02 pwbriggs

isbot is not used internally in Remix, it's used in templates.

Seems the breaking change (replace patterns with getPatterns) is not something that affects Remix usage of isbot since it only uses the isbot function.

sergiodxa avatar Feb 21 '24 18:02 sergiodxa

OP is referring to this:

https://github.com/remix-run/remix/blob/b0925f0d0be8c309e8cedbec6570d50c9219027a/packages/remix-dev/config.ts#L504-L524

aaronadamsCA avatar Feb 21 '24 18:02 aaronadamsCA

Yes, @aaronadamsCA is correct.

pwbriggs avatar Feb 22 '24 01:02 pwbriggs

Sigh - yeah personally I'm not too worried about Remix using v4 out of the box for the time being. It doesn't seem like the new breaking changes in v5 impact the Remix usage, and there's only a few more bot user agent pattern added from what I can tell.

Remix users can npm install isbot@5 and I think it will "just work" assuming they haven't made breaking changes to the module exports. We already have to do some sniffing in the default entry.server.tsx file - and I'm not super stoked about expanding that to support 3 major versions 😕

That said, it may not require any changes and v5 may just work in the >4 code path if the module exports are the same. If someone wants to do some exhaustive testing of the current logic across versions 3/4/5 and let us know if they all work then I think that would help. Otherwise, I'd vote to just update to v5 in the next major Remix release.

brophdawg11 avatar Feb 27 '24 19:02 brophdawg11

I'm not too worried about Remix using v4 out of the box for the time being.

Me neither, but since it's set as a dependency of the app itself, npm outdated and dependabot both bug users about it. Just something to consider for the developer experience. 🤷

pwbriggs avatar Feb 28 '24 04:02 pwbriggs

Yeah, unfortunately isbot had a lot of churn in just the past few months for such a simple package.

I understand their reasoning, but removing the default export in v4 was probably not a wise decision.

kiliman avatar Feb 28 '24 13:02 kiliman

So, is it safe to update to v5? Does it work fine with Remix?

HummingMind avatar Jun 29 '24 20:06 HummingMind

Yes - isbot v5 should work fine in Remix v2 if you want to update your package.json - they just removed a different named export which isn't used by the built in Remix entry.server: https://github.com/omrilotan/isbot/blob/main/CHANGELOG.md#500.

I'm going to close this out since the plan is to update to v5 in React Router v7: https://github.com/remix-run/react-router/pull/11770

brophdawg11 avatar Jul 03 '24 17:07 brophdawg11