@reticlehq/next 2.14.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.cjs +9 -5
  2. package/package.json +3 -3
package/index.cjs CHANGED
@@ -28,10 +28,9 @@ const RETICLE_WS_PATH = '/reticle';
28
28
  /**
29
29
  * Read the pairing token, or create it — whichever process gets there first.
30
30
  *
31
- * The token used to be read ONCE, when next.config was evaluated. Start `next dev` before the
32
- * daemon and that value was empty, every page was refused, and a reload could not help: there was
33
- * no token page-side to pick up. The comment that claimed "the client then connects without a token
34
- * and the page reloads once it has" was false for Next.
31
+ * Read once at `next.config` evaluation is NOT enough: start `next dev` before the daemon and the
32
+ * value is empty, every page is refused, and a reload cannot help because there is no token
33
+ * page-side to pick up.
35
34
  *
36
35
  * Same mint as the daemon (24 random bytes, 0600 file, never overwrite). An existing token is
37
36
  * reused so a plugin-injected page keeps working after the daemon bounces.
@@ -163,7 +162,12 @@ const LOADER_MODULE = '@reticlehq/next/loader';
163
162
  */
164
163
  function supportsTurbopackKey() {
165
164
  try {
166
- const { version } = require('next/package.json');
165
+ // From the APP, for the reason `resolveFromApp` records below: a bare require resolves against
166
+ // THIS package, so the version read could be some other copy of Next than the one about to run.
167
+ // Reading an older one returns false, no `turbopack` key is emitted, and on Next 16 — where
168
+ // Turbopack is the default — a config with a `webpack` key and no `turbopack` key is a hard
169
+ // `next dev` startup error. That is the failure the key exists to prevent.
170
+ const { version } = require(resolveFromApp('next/package.json'));
167
171
  const [major, minor] = String(version)
168
172
  .split('.')
169
173
  .map((n) => parseInt(n, 10));
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reticlehq/next",
3
- "version": "2.14.0",
3
+ "version": "3.2.0",
4
4
  "description": "Next.js helper for Reticle: keeps SWC, adds source-file mapping via a dev-only webpack pre-loader (data-reticle-source).",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Reticle contributors",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/reticlehq/reticle.git",
10
- "directory": "packages/next"
10
+ "directory": "adapters/build/next"
11
11
  },
12
12
  "homepage": "https://github.com/reticlehq/reticle#readme",
13
13
  "keywords": [
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@babel/core": "^7.26.0",
41
- "@reticlehq/babel-plugin": "2.14.0"
41
+ "@reticlehq/babel-plugin": "3.2.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "next": ">=13"