- Updated Node.js support to
^18.17.0 || >=20.4.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Use the Node.js test runner API and remove the dev dependency
test-director
. - Refactored tests to use the standard
fetch
API available in modern Node.js and removed the dev dependencynode-fetch
.
- Updated the
next
peer dependency to12 - 14
. - Updated the
package.json
fieldrepository
to conform to new npm requirements. - Integrated the ESLint plugin
eslint-plugin-optimal-modules
. - Updated GitHub Actions CI config:
- The workflow still triggers on push, but no longer on pull request.
- The workflow can now be manually triggered.
- Run tests with Node.js v18, v20, v21.
- Updated
actions/checkout
to v4. - Updated
actions/setup-node
to v4.
- Improved the types for test fixture Next.js config.
- Improved the test helper function
startNext
. - Added tests for the internal function
cjsDefaultImport
. - Updated link URLs in the readme.
- Updated the
next
peer dependency to12 - 13
. - Updated dev dependencies.
- Use a new internal helper function
cjsDefaultImport
to normalize the default import value from the CJS modulenext/app.js
that has adefault
property, preserving the type for the various ways TypeScript may be configured. - Simplified the test helper function
startNext
.
- Updated dev dependencies.
- Use the
node:
URL scheme for Node.js builtin module imports in tests. - Replaced the test helper function
fsPathRemove
with the functionrm
from the Node.js builtin modulenode:fs/promises
. - Revamped the readme:
- Removed the badges.
- Added information about TypeScript config and optimal JavaScript module design.
- Updated Node.js support to
^14.17.0 || ^16.0.0 || >= 18.0.0
. - Implemented TypeScript types via JSDoc comments, fixing #1.
- Updated the
react
peer dependency to16.14 - 18
.
- Updated dev dependencies.
- Simplified dev dependencies and config for ESLint.
- Removed the
jsdoc-md
dev dependency and the packagedocs-update
anddocs-check
scripts, replacing the readme “API” section with a manually written “Exports” section. - Check TypeScript types via a new package
types
script. - Removed the
@testing-library/react-hooks
dev dependency and rewrote React hook tests usingreact-test-renderer
and a custom React componentReactHookTest
. - Disabled Next.js build ESLint checks for test fixture Next.js projects.
- Upper-cased the first letter of the display name for the React component that the function
withServerContext
returns. - Updated GitHub Actions CI config:
- Run tests with Node.js v14, v16, v18.
- Updated
actions/checkout
to v3. - Updated
actions/setup-node
to v3.
- Use the
.mjs
file extension for Next.js pages in test fixtures. - Removed the now redundant
not IE > 0
from the Browserslist query. - Added a
license.md
MIT License file.
- Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0
. - Updated the
next
peer dependency to^12.0.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Public modules are now individually listed in the package
files
andexports
fields. - Removed
./package
from the packageexports
field; the fullpackage.json
filename must be used in arequire
path. - Removed the package main index module; deep imports must be used.
- Shortened public module deep import paths, removing the
/public/
. - The API is now ESM in
.mjs
files instead of CJS in.js
files, accessible viaimport
but notrequire
. - Switched back to using
React.createElement
instead of the the new React JSX runtime.
- Also run GitHub Actions CI with Node.js v17.
- Simplified package scripts.
- Reorganized the test file structure.
- Test the bundle sizes for public modules individually.
- Use a new
assertBundleSize
function to assert module bundle size in tests:- Failure message contains details about the bundle size and how much the limit was exceeded.
- Errors when the surplus is greater than 25% of the limit, suggesting the limit should be reduced.
- Resolves the minified bundle and its gzipped size for debugging in tests.
- Use Node.js
ok
assertions instead ofstrictEqual
where possible. - Updated the ESLint config.
- Removed a redundant prepare step that’s a no-op in current Next.js versions when programmatically starting Next.js in tests.
- Fixed internal JSDoc types.
- Configured Prettier option
singleQuote
to the default,false
. - Documentation tweaks.
- Updated the
next
peer dependency to9.0.3 - 11
. - Updated dev dependencies.
- Added the
eslint-config-next
dev dependency fornext
v11. - Renamed imports in the test index module.
- Amended the changelog entries for v2.0.0 and v3.0.0.
- Updated Node.js support to
^12.20 || >= 14.13
. - Updated browser support to the Browserslist query
> 0.5%, not OperaMini all, not IE > 0, not dead
. - Updated the
react
peer dependency to16.14 - 17
. - Updated dev dependencies, some of which require newer Node.js versions than were previously supported.
- Replaced the the
package.json
exports
field public subpath folder mapping (deprecated by Node.js) with a subpath pattern. Deeprequire
paths withinnext-server-context/public/
must now include the.js
file extension. - Use the new React JSX runtime.
- Removed Babel related dev dependencies, config, and scripts. Published modules now contain more modern ES syntax.
- Published modules now contain JSDoc comments, which might affect TypeScript projects.
- Added a package
test:api
script to test the API, using ESM in.mjs
files and new dev dependencies:
- Updated GitHub Actions CI config:
- Run tests with Node.js v12, v14, v16.
- Updated
actions/checkout
to v2. - Updated
actions/setup-node
to v2. - Don’t specify the
CI
environment variable as it’s set by default.
- Simplified JSDoc related package scripts now that
jsdoc-md
v10+ automatically generates a Prettier formatted readme. - Added a package
test:jsdoc
script that checks the readme API docs are up to date with the source JSDoc. - Test the bundle size manually using
esbuild
andgzip-size
, removingsize-limit
related dev dependencies, config, and scripts. - Use the
.js
file extension in internalrequire
paths. - Refactored an arrow function to a regular function within the function
withServerContext
. - Removed
npm-debug.log
from the.gitignore
file as npm v4.2.0+ doesn’t create it in the current working directory. - Improved documentation.
- Updated a URL in the v2.0.0 changelog entry.
- The file
changelog.md
is no longer published.
- Updated the package
engines.node
field to^10.17.0 || ^12.0.0 || >= 13.7.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Added a package
exports
field with conditional exports to support native ESM in Node.js and keep internal code private, whilst avoiding the dual package hazard. Published files have been reorganized, so previously undocumented deep imports will need to be rewritten according to the newly documented paths. - Removed the package
module
field.
- Updated the
next
peer dependency to9.0.3 - 10
. - Updated the
react
peer dependency to16.8 - 17
. - Updated dependencies.
- Removed the redundant
object-assign
dependency and relatedsize-limit
config. - Updated the package
keywords
field. - Ensure GitHub Actions run on pull request.
- Also run GitHub Actions with Node.js v14 and v15, and not v13.
- Simplified the GitHub Actions CI config with the
npm install-test
command. - Updated EditorConfig.
- Simplified the Babel config and scripts:
- Removed the
babel-plugin-transform-require-extensions
dev dependency. - Replaced the
prepare:mjs
andprepare:js
package scripts with aprepare:babel
script. - Use
.json
instead of.js
config. - Moved Browserslist config to the package
browserslist
field. - Ensure
.js
files are parsed as scripts.
- Removed the
- Updated test scripts.
- Configured Prettier option
semi
to the default,true
. - Lint fixes.
- Fixed typos in
useServerContext
examples. - Documented all the ways to
import
andrequire
the public API. - Misc. readme improvements.
- Allow
displayName
for React components to be eliminated in production builds.
Initial release.