@quilted/rollup 0.2.24 → 0.2.26
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/CHANGELOG.md +12 -0
- package/build/esm/app.mjs +6 -7
- package/build/esm/features/assets.mjs +5 -10
- package/build/esm/features/async.mjs +21 -29
- package/build/esm/features/css.mjs +3 -6
- package/build/esm/features/env.mjs +4 -8
- package/build/esm/features/graphql.mjs +6 -12
- package/build/esm/features/node.mjs +2 -4
- package/build/esm/features/source-code.mjs +2 -2
- package/build/esm/features/system-js.mjs +1 -2
- package/build/esm/features/typescript.mjs +1 -2
- package/build/esm/features/workers.mjs +8 -15
- package/build/esm/package.mjs +1 -2
- package/build/esm/shared/browserslist.mjs +6 -12
- package/build/esm/shared/magic-module.mjs +2 -4
- package/build/esm/shared/project.mjs +2 -4
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/app.d.ts.map +1 -1
- package/build/typescript/features/async.d.ts.map +1 -1
- package/package.json +2 -2
- package/source/app.ts +5 -9
- package/source/features/async.ts +11 -4
- package/source/features/source-code.ts +2 -2
- package/source/features/workers.ts +1 -1
- package/tsconfig.json +1 -1
package/source/app.ts
CHANGED
|
@@ -907,7 +907,7 @@ export function magicModuleAppRequestRouter({
|
|
|
907
907
|
return multiline`
|
|
908
908
|
import '@quilted/quilt/globals';
|
|
909
909
|
|
|
910
|
-
import {jsx} from '
|
|
910
|
+
import {jsx} from 'preact/jsx-runtime';
|
|
911
911
|
import {RequestRouter} from '@quilted/quilt/request-router';
|
|
912
912
|
import {renderToResponse} from '@quilted/quilt/server';
|
|
913
913
|
|
|
@@ -944,23 +944,19 @@ export function magicModuleAppBrowserEntry({
|
|
|
944
944
|
module: MAGIC_MODULE_ENTRY,
|
|
945
945
|
sideEffects: true,
|
|
946
946
|
async source() {
|
|
947
|
-
const reactRootFunction = hydrate ? '
|
|
947
|
+
const reactRootFunction = hydrate ? 'hydrate' : 'render';
|
|
948
948
|
|
|
949
949
|
return multiline`
|
|
950
950
|
import '@quilted/quilt/globals';
|
|
951
951
|
|
|
952
|
-
import {jsx} from '
|
|
953
|
-
import {${reactRootFunction}} from '
|
|
952
|
+
import {jsx} from 'preact/jsx-runtime';
|
|
953
|
+
import {${reactRootFunction}} from 'preact';
|
|
954
954
|
|
|
955
955
|
import App from ${JSON.stringify(MAGIC_MODULE_APP_COMPONENT)};
|
|
956
956
|
|
|
957
957
|
const element = document.querySelector(${JSON.stringify(selector)});
|
|
958
958
|
|
|
959
|
-
${
|
|
960
|
-
hydrate
|
|
961
|
-
? `${reactRootFunction}(element, jsx(App));`
|
|
962
|
-
: `${reactRootFunction}(element).render(jsx(App));`
|
|
963
|
-
}
|
|
959
|
+
${reactRootFunction}(jsx(App), element);
|
|
964
960
|
`;
|
|
965
961
|
},
|
|
966
962
|
});
|
package/source/features/async.ts
CHANGED
|
@@ -22,10 +22,17 @@ export function asyncModules({
|
|
|
22
22
|
return {
|
|
23
23
|
name: '@quilted/async',
|
|
24
24
|
async resolveId(id, importer) {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
let prefix: string;
|
|
26
|
+
|
|
27
|
+
if (id.startsWith(IMPORT_PREFIX)) {
|
|
28
|
+
prefix = IMPORT_PREFIX;
|
|
29
|
+
} else if (id.startsWith(MODULE_PREFIX)) {
|
|
30
|
+
prefix = MODULE_PREFIX;
|
|
31
|
+
} else {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
27
34
|
|
|
28
|
-
const imported = id.replace(
|
|
35
|
+
const imported = id.replace(prefix, '');
|
|
29
36
|
|
|
30
37
|
const resolved = await this.resolve(imported, importer, {
|
|
31
38
|
skipSelf: true,
|
|
@@ -33,7 +40,7 @@ export function asyncModules({
|
|
|
33
40
|
|
|
34
41
|
if (resolved == null) return null;
|
|
35
42
|
|
|
36
|
-
return `\0${
|
|
43
|
+
return `\0${prefix}${resolved.id}`;
|
|
37
44
|
},
|
|
38
45
|
resolveDynamicImport(specifier) {
|
|
39
46
|
if (
|
|
@@ -29,7 +29,7 @@ export function sourceCode({
|
|
|
29
29
|
// Support very modern features
|
|
30
30
|
target: 'es2022',
|
|
31
31
|
jsx: 'automatic',
|
|
32
|
-
jsxImportSource: typeof react === 'string' ? react : '
|
|
32
|
+
jsxImportSource: typeof react === 'string' ? react : 'preact',
|
|
33
33
|
exclude: 'node_modules/**',
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -47,7 +47,7 @@ export function sourceCode({
|
|
|
47
47
|
require.resolve('@babel/preset-react'),
|
|
48
48
|
{
|
|
49
49
|
runtime: 'automatic',
|
|
50
|
-
importSource: typeof react === 'string' ? react : '
|
|
50
|
+
importSource: typeof react === 'string' ? react : 'preact',
|
|
51
51
|
development: mode === 'development',
|
|
52
52
|
},
|
|
53
53
|
],
|
|
@@ -269,7 +269,7 @@ const workerFunctionContent = (pkg: string) =>
|
|
|
269
269
|
|
|
270
270
|
const KNOWN_WRAPPER_MODULES = new Map<string, Map<string, string>>([
|
|
271
271
|
['@quilted/workers', workerFunctionContent('@quilted/workers')],
|
|
272
|
-
['@quilted/
|
|
272
|
+
['@quilted/preact-workers', workerFunctionContent('@quilted/preact-workers')],
|
|
273
273
|
['@quilted/quilt/threads', workerFunctionContent('@quilted/quilt/threads')],
|
|
274
274
|
]);
|
|
275
275
|
|
package/tsconfig.json
CHANGED