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

NEX-25: Update to next-drupal 1.6.0, next 1.6.0 and next.js 13 #28

Merged
merged 11 commits into from
Dec 9, 2022

Conversation

vermario
Copy link
Collaborator

@vermario vermario commented Dec 9, 2022

Link to ticket: https://wunder.atlassian.net/browse/NEX-25

Changes proposed in this PR:

  • fix storybook setup, which was broken by the introduction of the next-i18next package and did not understand typescript module imports
  • update the next-drupal package to latest (1.6.0) in next
  • update to next.js 13
    • use the new Link component (using codemod)
    • use the new Image component (using codemod)
  • update to the next drupal module latest version
    • updated exported configuration in the recipe with revalidator path, updated our custom hook

How to test:

  • Follow the readme, create some content and see it displayed in the site.

@vermario vermario changed the title Feature/nex 25 NEX-25: Update to next-drupal 1.6.0, next 1.6.0 and next.js 13 Dec 9, 2022
@vermario vermario requested review from juhov and saqib053 December 9, 2022 11:45
},
webpackFinal: async (config) => {
config.resolve.plugins = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This config and the next are taken from https://theodorusclarence.com/blog/nextjs-storybook-tailwind

builder: "@storybook/builder-webpack5",
},
webpackFinal: async (config) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one will make storybook recognize paths like "components/somecomponent", taken from storybookjs/storybook#14087 (comment)

@@ -1,3 +1,5 @@
import "../styles/globals.css";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this way the components will display the right styles in storybook:

image

@@ -6,3 +6,5 @@ label: 'Next.js frontend'
base_url: 'http://localhost:3000'
preview_url: 'http://localhost:3000/api/preview'
preview_secret: null
revalidate_url: 'http://localhost:3000/api/revalidate'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This configuration is for now empty, I have made a new story to actually activate this functionality: https://wunder.atlassian.net/browse/NEX-26

*/
config.resolve.roots = [
path.resolve(__dirname, "../public"),
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: No need to change anything, but Storybook has staticDirs config that could be used for this too.

Copy link
Contributor

@juhov juhov left a comment

Choose a reason for hiding this comment

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

Everything seems to work after these updates/fixes 👍

@vermario vermario merged commit 05b85a6 into main Dec 9, 2022
@tharna tharna deleted the feature/NEX-25 branch April 28, 2023 10:20
jekku123 pushed a commit that referenced this pull request Oct 20, 2024
NEX-25: Update to next-drupal 1.6.0, next 1.6.0 and next.js 13
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