@jsenv/plugin-preact 0.3.7 → 0.3.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-preact",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,11 +27,11 @@
27
27
  "babel-plugin-transform-hook-names": "1.0.2",
28
28
  "@babel/plugin-transform-react-jsx": "7.19.0",
29
29
  "@babel/plugin-transform-react-jsx-development": "7.18.6",
30
- "@jsenv/ast": "1.3.0",
30
+ "@jsenv/ast": "1.3.1",
31
31
  "@jsenv/sourcemap": "1.0.5",
32
32
  "@jsenv/url-meta": "7.0.0",
33
33
  "@prefresh/babel-plugin": "0.4.3",
34
- "@prefresh/core": "1.3.4",
34
+ "@prefresh/core": "1.4.1",
35
35
  "@prefresh/utils": "1.1.3"
36
36
  },
37
37
  "peerDependencies": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@jsenv/core": "../../",
42
- "preact": "10.10.6",
42
+ "preact": "10.11.0",
43
43
  "react-redux": "8.0.2",
44
44
  "redux": "4.2.0"
45
45
  }
@@ -27,6 +27,9 @@ export const jsenvPluginPreact = ({
27
27
  },
28
28
  preactDevtoolsDuringBuild = false,
29
29
  } = {}) => {
30
+ if (!refreshInclude) {
31
+ refreshInclude = {}
32
+ }
30
33
  const associations = URL_META.resolveAssociations(
31
34
  {
32
35
  jsx: jsxInclude,
@@ -82,7 +85,10 @@ import ${preactDevtoolsReference.generatedSpecifier}
82
85
  associations,
83
86
  })
84
87
  const jsxEnabled = urlMeta.jsx
85
- const refreshEnabled = context.scenarios.dev ? urlMeta.refresh : false
88
+ const refreshEnabled = context.scenarios.dev
89
+ ? urlMeta.refresh &&
90
+ !urlInfo.content.includes("import.meta.hot.decline()")
91
+ : false
86
92
  const hookNamesEnabled =
87
93
  context.scenarios.dev &&
88
94
  urlMeta.hookNames &&
@@ -90,7 +96,6 @@ import ${preactDevtoolsReference.generatedSpecifier}
90
96
  urlInfo.content.includes("useReducer") ||
91
97
  urlInfo.content.includes("useRef") ||
92
98
  urlInfo.content.includes("useMemo"))
93
-
94
99
  const { code, map } = await applyBabelPlugins({
95
100
  babelPlugins: [
96
101
  ...(jsxEnabled