@qwik.dev/core 2.0.0-alpha.3 → 2.0.0-alpha.5

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.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-alpha.3-dev+418fd6d",
3
+ "version": "2.0.0-alpha.5-dev+cb53bbd",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-alpha.3-dev+418fd6d
3
+ * @qwik.dev/core/cli 2.0.0-alpha.5-dev+cb53bbd
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -5177,8 +5177,10 @@ function updateFileContent(path3, content) {
5177
5177
  (0, import_fs3.writeFileSync)(path3, content);
5178
5178
  f2.info(`"${path3}" has been updated`);
5179
5179
  }
5180
- function replacePackage(oldPackageName, newPackageName) {
5181
- replacePackageInDependencies(oldPackageName, newPackageName);
5180
+ function replacePackage(oldPackageName, newPackageName, skipDependencies = false) {
5181
+ if (!skipDependencies) {
5182
+ replacePackageInDependencies(oldPackageName, newPackageName);
5183
+ }
5182
5184
  replaceMentions(oldPackageName, newPackageName);
5183
5185
  }
5184
5186
  function replacePackageInDependencies(oldPackageName, newPackageName) {
@@ -5316,6 +5318,27 @@ async function removeTsMorphFromPackageJson() {
5316
5318
  const packageJson = await readPackageJson(process.cwd());
5317
5319
  (_a = packageJson.dependencies) == null ? true : delete _a["ts-morph"];
5318
5320
  (_b = packageJson.devDependencies) == null ? true : delete _b["ts-morph"];
5321
+ await writePackageJson(process.cwd(), packageJson);
5322
+ }
5323
+
5324
+ // packages/qwik/src/cli/migrate-v2/update-configurations.ts
5325
+ var import_fs4 = require("fs");
5326
+ init_dist2();
5327
+ function updateConfigurations() {
5328
+ try {
5329
+ updateTsconfig();
5330
+ } catch (error) {
5331
+ f2.error("Failed to update tsconfig.json configuration.");
5332
+ }
5333
+ }
5334
+ function updateTsconfig() {
5335
+ const tsConfigPath = "tsconfig.json";
5336
+ const tsConfig = JSON.parse((0, import_fs4.readFileSync)(tsConfigPath, "utf-8"));
5337
+ if (!tsConfig) {
5338
+ return;
5339
+ }
5340
+ tsConfig.compilerOptions.moduleResolution = "bundler";
5341
+ (0, import_fs4.writeFileSync)(tsConfigPath, JSON.stringify(tsConfig, null, 2));
5319
5342
  }
5320
5343
 
5321
5344
  // packages/qwik/src/cli/migrate-v2/run-migration.ts
@@ -5349,12 +5372,19 @@ ${bold(bgRed('Warning: migration tool is experimental and will migrate your appl
5349
5372
  ],
5350
5373
  "@builder.io/qwik-city"
5351
5374
  );
5375
+ replaceImportInFiles2(
5376
+ [["qwikCityPlan", "qwikRouterConfig"]],
5377
+ "@qwik-city-plan"
5378
+ // using old name, package name will be updated in the next step
5379
+ );
5380
+ replacePackage("@qwik-city-plan", "@qwik-router-config", true);
5352
5381
  replacePackage("@builder.io/qwik-city", "@qwik.dev/router");
5353
5382
  replacePackage("@builder.io/qwik-react", "@qwik.dev/react");
5354
5383
  replacePackage("@builder.io/qwik", "@qwik.dev/core");
5355
5384
  if (installedTsMorph) {
5356
5385
  await removeTsMorphFromPackageJson();
5357
5386
  }
5387
+ updateConfigurations();
5358
5388
  await updateDependencies();
5359
5389
  f2.success(`${green(`Your application has been successfully migrated to v2!`)}`);
5360
5390
  } catch (error) {
@@ -5504,7 +5534,7 @@ async function printHelp(app) {
5504
5534
  await runCommand2(Object.assign(app, { task: args[0], args }));
5505
5535
  }
5506
5536
  function printVersion() {
5507
- console.log("2.0.0-alpha.3-dev+418fd6d");
5537
+ console.log("2.0.0-alpha.5-dev+cb53bbd");
5508
5538
  }
5509
5539
  // Annotate the CommonJS export names for ESM import in node:
5510
5540
  0 && (module.exports = {
@@ -1,4 +1,7 @@
1
1
  import * as CSS_2 from 'csstype';
2
+ import { isBrowser } from './build';
3
+ import { isDev } from './build';
4
+ import { isServer } from './build';
2
5
  import type { StreamWriter as StreamWriter_2 } from '.';
3
6
 
4
7
  /**
@@ -370,7 +373,7 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
370
373
  declare type Booleanish = boolean | `${boolean}`;
371
374
 
372
375
  declare const enum ChoreType {
373
- MACRO = 112,
376
+ MACRO = 240,
374
377
  MICRO = 15,
375
378
  /** Ensure tha the QRL promise is resolved before processing next chores in the queue */
376
379
  QRL_RESOLVE = 1,
@@ -380,11 +383,11 @@ declare const enum ChoreType {
380
383
  NODE_PROP = 5,
381
384
  COMPONENT_SSR = 6,
382
385
  COMPONENT = 7,
383
- WAIT_FOR_COMPONENTS = 16,
384
- JOURNAL_FLUSH = 48,
385
- VISIBLE = 64,
386
- CLEANUP_VISIBLE = 80,
387
- WAIT_FOR_ALL = 127
386
+ RECOMPUTE_AND_SCHEDULE_EFFECTS = 8,
387
+ JOURNAL_FLUSH = 16,
388
+ VISIBLE = 32,
389
+ CLEANUP_VISIBLE = 48,
390
+ WAIT_FOR_ALL = 255
388
391
  }
389
392
 
390
393
  /**
@@ -782,7 +785,7 @@ declare const createScheduler: (container: Container, scheduleDrain: () => void,
782
785
  (type: ChoreType.QRL_RESOLVE, ignore: null, target: QRLInternal<(...args: unknown[]) => unknown>): ValueOrPromise<void>;
783
786
  (type: ChoreType.JOURNAL_FLUSH): ValueOrPromise<void>;
784
787
  (type: ChoreType.WAIT_FOR_ALL): ValueOrPromise<void>;
785
- (type: ChoreType.WAIT_FOR_COMPONENTS): ValueOrPromise<void>;
788
+ (type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal): ValueOrPromise<void>;
786
789
  (type: ChoreType.TASK | ChoreType.VISIBLE | ChoreType.RESOURCE, task: Task): ValueOrPromise<void>;
787
790
  (type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): ValueOrPromise<JSXOutput>;
788
791
  (type: ChoreType.COMPONENT_SSR, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): ValueOrPromise<JSXOutput>;
@@ -906,9 +909,9 @@ export declare type EagernessOptions = 'visible' | 'load' | 'idle';
906
909
  declare type Effect = Task | _VNode | ISsrNode | Signal_2;
907
910
 
908
911
  /** @internal */
909
- export declare class _EffectData<T extends Record<string, any> = Record<string, any>> {
910
- data: T;
911
- constructor(data: T);
912
+ export declare class _EffectData {
913
+ data: NodePropData;
914
+ constructor(data: NodePropData);
912
915
  }
913
916
 
914
917
  /**
@@ -1263,6 +1266,10 @@ declare type IsAcceptableDOMValue<T> = T extends boolean | number | string | nul
1263
1266
 
1264
1267
  declare type IsAny<T> = 0 extends T & 1 ? true : false;
1265
1268
 
1269
+ export { isBrowser }
1270
+
1271
+ export { isDev }
1272
+
1266
1273
  /** @internal */
1267
1274
  export declare const _isJSXNode: <T>(n: unknown) => n is JSXNodeInternal<T>;
1268
1275
 
@@ -1272,6 +1279,8 @@ declare type IsReadOnlyKey<T, K extends keyof T> = IfEquals<{
1272
1279
  -readonly [Q in K]: T[K];
1273
1280
  }, false, true>;
1274
1281
 
1282
+ export { isServer }
1283
+
1275
1284
  /** @public */
1276
1285
  export declare const isSignal: (value: any) => value is Signal<unknown>;
1277
1286
 
@@ -1495,6 +1504,11 @@ export declare type NativeUIEvent = UIEvent;
1495
1504
  /** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
1496
1505
  export declare type NativeWheelEvent = WheelEvent;
1497
1506
 
1507
+ declare interface NodePropData {
1508
+ $scopedStyleIdPrefix$: string | null;
1509
+ $isConst$: boolean;
1510
+ }
1511
+
1498
1512
  /** @internal */
1499
1513
  export declare const _noopQrl: <T>(symbolName: string, lexicalScopeCapture?: any[]) => QRL<T>;
1500
1514
 
@@ -2328,7 +2342,7 @@ export declare abstract class _SharedContainer implements Container {
2328
2342
  $currentUniqueId$: number;
2329
2343
  $instanceHash$: string | null;
2330
2344
  constructor(scheduleDrain: () => void, journalFlush: () => void, serverData: Record<string, any>, locale: string);
2331
- trackSignalValue<T>(signal: Signal, subscriber: Effect, property: string, data: _EffectData): T;
2345
+ trackSignalValue<T>(signal: Signal, subscriber: HostElement, property: string, data: _EffectData): T;
2332
2346
  serializationCtxFactory(NodeConstructor: {
2333
2347
  new (...rest: any[]): {
2334
2348
  nodeType: number;
@@ -2375,7 +2389,7 @@ declare class Signal_2<T = any> implements Signal<T> {
2375
2389
  set untrackedValue(value: T);
2376
2390
  get value(): T;
2377
2391
  set value(value: T);
2378
- valueOf(): undefined;
2392
+ valueOf(): void;
2379
2393
  toString(): string;
2380
2394
  toJSON(): {
2381
2395
  value: T;
@@ -2738,7 +2752,7 @@ export declare interface StreamWriter {
2738
2752
  export declare type _Stringifiable = string | boolean | number | null;
2739
2753
 
2740
2754
  declare abstract class Subscriber {
2741
- $effectDependencies$: Subscriber[] | null;
2755
+ $effectDependencies$: (Subscriber | TargetType)[] | null;
2742
2756
  }
2743
2757
 
2744
2758
  /**
@@ -3718,7 +3732,7 @@ export declare const _VAR_PROPS: unique symbol;
3718
3732
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
3719
3733
 
3720
3734
  /**
3721
- * 2.0.0-alpha.3-dev+418fd6d
3735
+ * 2.0.0-alpha.5-dev+cb53bbd
3722
3736
  *
3723
3737
  * @public
3724
3738
  */
@@ -3777,12 +3791,18 @@ export declare type _VNode = _ElementVNode | _TextVNode | _VirtualVNode;
3777
3791
  */
3778
3792
  declare type VNodeData = [VNodeDataFlag, ...(SsrAttrs | number)[]];
3779
3793
 
3794
+ /**
3795
+ * Flags for VNodeData (Flags con be bitwise combined)
3796
+ *
3797
+ * @internal
3798
+ */
3780
3799
  declare const enum VNodeDataFlag {
3781
3800
  NONE = 0,
3782
3801
  TEXT_DATA = 1,
3783
3802
  VIRTUAL_NODE = 2,
3784
- REFERENCE = 4,
3785
- SERIALIZE = 8
3803
+ ELEMENT_NODE = 4,
3804
+ REFERENCE = 8,
3805
+ SERIALIZE = 16
3786
3806
  }
3787
3807
 
3788
3808
  /**
@@ -3873,6 +3893,8 @@ declare class WrappedSignal<T> extends Signal_2<T> implements Subscriber {
3873
3893
  $funcStr$: string | null;
3874
3894
  $invalid$: boolean;
3875
3895
  $effectDependencies$: Subscriber[] | null;
3896
+ $hostElement$: HostElement | null;
3897
+ $forceRunEffects$: boolean;
3876
3898
  constructor(container: Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null);
3877
3899
  $invalidate$(): void;
3878
3900
  /**
@@ -3881,7 +3903,7 @@ declare class WrappedSignal<T> extends Signal_2<T> implements Subscriber {
3881
3903
  */
3882
3904
  force(): void;
3883
3905
  get untrackedValue(): T;
3884
- private $computeIfNeeded$;
3906
+ $computeIfNeeded$(): boolean;
3885
3907
  get value(): any;
3886
3908
  set value(_: any);
3887
3909
  }