@octanejs/mdx 0.1.25 → 0.1.27

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/package.json +4 -4
  2. package/src/vite.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/mdx",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -56,14 +56,14 @@
56
56
  "source-map": "^0.7.6"
57
57
  },
58
58
  "peerDependencies": {
59
- "octane": "0.1.28"
59
+ "octane": "0.1.30"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@shikijs/rehype": "^3.23.0",
63
63
  "vite": "^8.1.5",
64
64
  "vitest": "^4.1.10",
65
- "@octanejs/testing-library": "0.1.25",
66
- "octane": "0.1.28"
65
+ "@octanejs/testing-library": "0.1.27",
66
+ "octane": "0.1.30"
67
67
  },
68
68
  "scripts": {
69
69
  "test": "vitest run"
package/src/vite.js CHANGED
@@ -20,7 +20,7 @@
20
20
  * exactly as written and never applies TS-style `.js` → `.ts` mapping.
21
21
  */
22
22
  import { compileMdx } from './compile.js';
23
- import { createOctaneCompiler } from 'octane/compiler/bundler';
23
+ import { createOctaneCompiler, HYDRATE_QUERY_PARAM } from 'octane/compiler/bundler';
24
24
 
25
25
  /**
26
26
  * @typedef {Omit<import('./compile.js').CompileMdxOptions, 'mode' | 'hmr' | 'dev'> & {
@@ -97,7 +97,12 @@ export function octaneMdx(options = {}) {
97
97
  for (const dependency of profileIdentity?.dependencies ?? []) {
98
98
  this.addWatchFile?.(dependency);
99
99
  }
100
- const compilerId = profileIdentity?.id ?? file;
100
+ const baseCompilerId = profileIdentity?.id ?? file;
101
+ const hydrateBoundaryPath = new URLSearchParams(query).get(HYDRATE_QUERY_PARAM);
102
+ const compilerId =
103
+ hydrateBoundaryPath === null
104
+ ? baseCompilerId
105
+ : `${baseCompilerId}?${HYDRATE_QUERY_PARAM}=${encodeURIComponent(hydrateBoundaryPath)}`;
101
106
  const result = await compileMdx(code, compilerId, {
102
107
  ...compileOptions,
103
108
  mode: ssr ? 'server' : 'client',