Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade JS dependencies to latest versions #66

Merged
merged 9 commits into from
Nov 2, 2024
Merged

Conversation

jefflloyd
Copy link
Contributor

@jefflloyd jefflloyd commented Nov 1, 2024

This will be easier to review commit-by-commit.

This PR upgrades all dependencies in package.json to their latest (or near-latest) versions. There were several breaking version changes that had to be applied as a result. I've added some inline comments to describe some of the larger changes.

I verified the site still worked by running npm run dev and validating that I could perform the basic actions (viewing various pages, hotkeys, searching for workflows, copying snippets, etc).

Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
commands-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 9:50pm

@@ -14,7 +14,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "17.x"
node-version: "20.x"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little bizarre - CI specified 17.x, but our Vercel deployment was still using 14.x (it doesn't even support non-LTS versions). Now, they're both using 20.x.

Comment on lines -26 to +27
<Link href={destination}>
<a className={CARD_STYLE} onClick={trackClick}>
{children}
</a>
<Link href={destination} className={CARD_STYLE} onClick={trackClick}>
{children}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Link> components now render directly as <a> tags as of Next 13. See this for more details. I ran their suggested codemod to upgrade our usages.

}) {
if (!searchState.query || searchState.query.length == 0) {
function Hits({ children }: { children: React.ReactNode }) {
const { results } = useInstantSearch();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connectStateResults was removed in react-instantsearch v7. They recommend getting the same information about state/results from this useInstantSearch() hook instead.

@@ -44,4 +48,14 @@ function SearchBox({ refine }: { refine: Dispatch<SetStateAction<string>> }) {
);
}

function connectSearchBox(Component: any) {
const SearchBox = (props: any) => {
const data = useSearchBox(props);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar story here - useSearchBox replaced connectSearchBox. This is lightly adapted from their documentation.

// Initialize the index with the algolia index name we set up
const index = client.initIndex("workflow_specs");

const indexName = "workflow_specs";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In version 4 of algoliasearch, you called initIndex on a client, which would then use that index for all future calls. Now, you provide the index to those individual calls. See here for more info.

@@ -7,7 +7,7 @@ import Layout from "../../components/layout";
import WorkflowTags from "../../components/WorkflowTags";
import { Argument, Workflow } from "warp-workflows";
import { CopyIcon } from "../../components/icons/copy";
import ReactTooltip from "react-tooltip";
import { Tooltip } from "react-tooltip";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet another major version upgrade with a slightly different API. See the upgrade guide for more details on these changes.

@@ -41,5 +41,4 @@ module.exports = {
},
},
},
plugins: [require("@tailwindcss/line-clamp")],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is included as of Tailwind v3.3, so we don't need to explicitly include it anymore.

@jefflloyd jefflloyd marked this pull request as ready for review November 1, 2024 22:02
@acarl005 acarl005 self-requested a review November 2, 2024 01:05
Copy link

@acarl005 acarl005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for doing this

@jefflloyd jefflloyd merged commit 3867c9d into main Nov 2, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants