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

Update to Next 14! #409

Open
advaithg opened this issue Jan 26, 2022 · 2 comments · May be fixed by #688
Open

Update to Next 14! #409

advaithg opened this issue Jan 26, 2022 · 2 comments · May be fixed by #688
Assignees

Comments

@advaithg
Copy link
Contributor

advaithg commented Jan 26, 2022

Resolve #400

Refer to Next 12's release notes here

A huge breaking change to deal with is that merging this in will result in the surrounding element for next/image being a <span> instead of a <div>, making them inline by default, so that will have to be fixed for all uses of <Image> in our codebase that are impacted
(see this deploy preview's carousel for an example of something breaking)

@mattxwang
Copy link
Contributor

mattxwang commented Jan 27, 2022

This is not related to #406 - that changelog has nothing to do with Next 12.

This does affect lint, etc., other packages that need to be updated in lockstep with Next 12.

Also keep in mind the previous problem I encountered - deploying Next 12 on Netlify without using Netlify functions, since that's not within our budget.

mattxwang added a commit that referenced this issue Jan 31, 2022
This PR implements the minimum overhead required to run `jest-axe` via GitHub Actions on a set of predefined components. In order, we:

1. install `jest`, `jest-axe`, `@testing-library/react`, `@testing-library/jest-dom`, the minimum set up for a viable test infrastructure
    1. to install `jest`, we add a general `jest.config.js` as a jest configuration file, and `jest.setup.js` as a pre-test setup file (automatically importing our dependencies)
    2. creates a set of mock module mappers for "non-code" webpack elements; a stub file mock (`__mocks__/fileMock.js`) for most files, and the `identity-obj-proxy` to proxy-back CSS/SASS/SCSS class names
    3. adds the `next` preset to babel
    4. adjusts the ESLint config to use the jest environment
2. implements a rudimentary accessibility test in `NewsArticle.test.js`, which is a simple subcomponent with no errors. You can validate this working by adding an arbitrary `<img />` to `NewsArticle.js`; `npm test` will throw an error.
3. implements a rudimentary failing accessibility test in `Footer.test.js`, where an `<ul>` has children that are not `<li>` - showing that negatives work. I then resolve this issue.
4. updates the "Node.JS CI" action to be "Build and Test", and runs `npm test` in it

Ideally, you should be able to add more test files following the configuration in `NewsArticle.test.js`; note the strange `let` pattern with the async version of `act`.

I didn't use the native next testing plugin, since that seems blocked by the upgrade to Next 12 (#409).

Part of #218, supersedes #301.

Relevant reading:

* [Configuring Jest](https://jestjs.io/docs/configuration)
* [`act()` in React](https://reactjs.org/docs/test-utils.html#act)
* [Blog Post: Next.js 11: Setup & Config for Testing, Linting, and Absolute Imports](https://benjaminwfox.medium.com/next-js-setup-config-for-testing-linting-and-absolute-imports-605959d7bd6f)
@matthewcn56
Copy link
Member

Also keep in mind the previous problem I encountered - deploying Next 12 on Netlify without using Netlify functions, since that's not within our budget.

I think Netlify functions are within our budget, we just have to be wary of how many times they can possibly get triggered and make sure that we don't go over the 100k invocation limit every month.

@ArshMalik02 ArshMalik02 changed the title Update to Next 12! Update to Next 14! May 17, 2024
@snigdha-kansal snigdha-kansal linked a pull request May 19, 2024 that will close this issue
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 a pull request may close this issue.

4 participants