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

Add navigation entry point compatible with Next.js App Router #600

Merged
merged 5 commits into from
Nov 22, 2023

Conversation

JohnAlbin
Copy link
Collaborator

@JohnAlbin JohnAlbin commented Nov 17, 2023

This pull request is for:

  • packages/next-drupal

GitHub Issue: #442

Describe your changes

Moves the use-menu hook to a new entry point so that developers can import any of the other exports from the main entry point into their Server Components.

Also switches from microbundle to tsup, a TypeScript-specific bundler that has built-in support for build-specific type definition files. And upgrades TypeScript to v5 from v4.

Copy link

vercel bot commented Nov 17, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-drupal ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2023 10:53am

Copy link

github-actions bot commented Nov 17, 2023

🎉 Experimental release published 📦️ on npm!

pnpm add next-drupal@0.0.0-pr.600.128d03bc
yarn add next-drupal@0.0.0-pr.600.128d03bc
npm i next-drupal@0.0.0-pr.600.128d03bc

@JohnAlbin
Copy link
Collaborator Author

Seeing the TypeError: Jsona is not a constructor error with the next-drupal@0.0.0-pr.600.6bd1d292 release too. :)

@JohnAlbin
Copy link
Collaborator Author

JohnAlbin commented Nov 17, 2023

The next-drupal@0.0.0-pr.600.009cb667 release works with App Router without any errors!

Fixes #442

BREAKING CHANGE:

The useMenu() client hook has moved out of the main entry point and into its own
entry point. Any import or require of that function needs to be updated:

Old usage:
```js
import { useMenu } from "next-drupal"
```

New usage:
```js
import { useMenu } from "next-drupal/navigation"
```
Prevents "TypeError: Jsona is not a constructor" error
Copy link
Member

@robdecker robdecker left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@JohnAlbin JohnAlbin merged commit 32a5a0a into main Nov 22, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants