diff --git a/.REFACTOR_NOTES.md b/.REFACTOR_NOTES.md
new file mode 100644
index 00000000000..94fe1b685c5
--- /dev/null
+++ b/.REFACTOR_NOTES.md
@@ -0,0 +1,44 @@
+1 << 0 | 001 | static listeners
+1 << 1 | 002 | static subtree
+
+## Slots
+
+```typescript
+const Parent = component$(() => {
+ return (
+
This is the sub page.
+{loaded.value}
+ > + ); +}); diff --git a/e2e/adapters-e2e/src/routes/profile/index.tsx b/e2e/adapters-e2e/src/routes/profile/index.tsx index 1f6f835a4b2..e210d13b7c8 100644 --- a/e2e/adapters-e2e/src/routes/profile/index.tsx +++ b/e2e/adapters-e2e/src/routes/profile/index.tsx @@ -1,4 +1,4 @@ -import { component$ } from '@builder.io/qwik'; +import { component$ } from '@qwik.dev/core'; export default component$(() => { return ( diff --git a/e2e/adapters-e2e/src/routes/service-worker.ts b/e2e/adapters-e2e/src/routes/service-worker.ts index fb1bb3fd75e..e69de29bb2d 100644 --- a/e2e/adapters-e2e/src/routes/service-worker.ts +++ b/e2e/adapters-e2e/src/routes/service-worker.ts @@ -1,18 +0,0 @@ -/* - * WHAT IS THIS FILE? - * - * The service-worker.ts file is used to have state of the art prefetching. - * https://qwik.dev/qwikcity/prefetching/overview/ - * - * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline. - * You can also use this file to add more functionality that runs in the service worker. - */ -import { setupServiceWorker } from '@builder.io/qwik-city/service-worker'; - -setupServiceWorker(); - -addEventListener('install', () => self.skipWaiting()); - -addEventListener('activate', () => self.clients.claim()); - -declare const self: ServiceWorkerGlobalScope; diff --git a/e2e/adapters-e2e/tests/express.spec.ts b/e2e/adapters-e2e/tests/express.spec.ts index 77e1e7ec5cc..90dead2f81e 100644 --- a/e2e/adapters-e2e/tests/express.spec.ts +++ b/e2e/adapters-e2e/tests/express.spec.ts @@ -1,5 +1,12 @@ import { expect, test } from '@playwright/test'; +test.beforeEach(async ({ page }) => { + page.on('console', (msg) => { + // eslint-disable-next-line no-console + console.log(`[browser ${msg.type()}] ${msg.text()}`); + }); +}); + test.describe('Verifying Express Adapter', () => { test('should ignore unknown qdata', async ({ page, request }) => { page.goto('/'); @@ -25,4 +32,15 @@ test.describe('Verifying Express Adapter', () => { await expect(page.getByRole('heading', { name: 'Profile page' })).toBeVisible(); }); + + test('should load loaders context in minified prod mode', async ({ page }) => { + page.goto('/loaders'); + const subpageLink = page.locator('#subpage-link'); + await expect(subpageLink).toBeVisible(); + + await subpageLink.click(); + + await expect(page.getByRole('heading', { name: 'Sub page' })).toBeVisible(); + await expect(page.locator('#subpage-loader-value')).toHaveText('42'); + }); }); diff --git a/e2e/adapters-e2e/tsconfig.json b/e2e/adapters-e2e/tsconfig.json index 634e8d388b9..97ae6fad669 100644 --- a/e2e/adapters-e2e/tsconfig.json +++ b/e2e/adapters-e2e/tsconfig.json @@ -6,7 +6,7 @@ "module": "ES2022", "lib": ["es2022", "DOM", "WebWorker", "DOM.Iterable"], "jsx": "react-jsx", - "jsxImportSource": "@builder.io/qwik", + "jsxImportSource": "@qwik.dev/core", "strict": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, diff --git a/e2e/adapters-e2e/vite.config.ts b/e2e/adapters-e2e/vite.config.ts index d50e689ddd6..3cee74fea64 100644 --- a/e2e/adapters-e2e/vite.config.ts +++ b/e2e/adapters-e2e/vite.config.ts @@ -2,8 +2,8 @@ * This is the base config for vite. When building, the adapter config is used which loads this file * and extends it. */ -import { qwikCity } from '@builder.io/qwik-city/vite'; -import { qwikVite } from '@builder.io/qwik/optimizer'; +import { qwikRouter } from '@qwik.dev/router/vite'; +import { qwikVite } from '@qwik.dev/core/optimizer'; import { defineConfig, type UserConfig } from 'vite'; import tsconfigPaths from 'vite-tsconfig-paths'; import pkg from './package.json'; @@ -17,12 +17,12 @@ const { dependencies = {}, devDependencies = {} } = pkg as any as { errorOnDuplicatesPkgDeps(devDependencies, dependencies); /** - * Note that Vite normally starts from `index.html` but the qwikCity plugin makes start at + * Note that Vite normally starts from `index.html` but the qwikRouter plugin makes start at * `src/entry.ssr.tsx` instead. */ export default defineConfig((): UserConfig => { return { - plugins: [qwikCity(), qwikVite(), tsconfigPaths({ root: '.' })], + plugins: [qwikRouter(), qwikVite(), tsconfigPaths({ root: '.' })], // This tells Vite which dependencies to pre-build in dev mode. optimizeDeps: { // Put problematic deps that break bundling here, mostly those with binaries. diff --git a/e2e/qwik-cli-e2e/README.md b/e2e/qwik-cli-e2e/README.md index 3320cf62cd1..2b360645c50 100644 --- a/e2e/qwik-cli-e2e/README.md +++ b/e2e/qwik-cli-e2e/README.md @@ -10,7 +10,7 @@ Tests can be invoked by running `pnpm run test.e2e.cli`. E2E project does the following internally: -0. Vitest is configured to run a setup function once **PRIOR TO ALL** tests. During the setup `@builder.io/qwik`, `@builder.io/qwik-city` and `eslint-plugin-qwik` packages will be packed with `pnpm pack` Those will be used at a step 2 for every test. Tarballs are located in `temp/tarballs` folder within this repo. It is assumed that packages are built before E2E is executed. +0. Vitest is configured to run a setup function once **PRIOR TO ALL** tests. During the setup `@qwik.dev/core`, `@qwik.dev/router` and `eslint-plugin-qwik` packages will be packed with `pnpm pack` Those will be used at a step 2 for every test. Tarballs are located in `temp/tarballs` folder within this repo. It is assumed that packages are built before E2E is executed. 1. Simulates `npm create qwik` locally using direct command `node packages/create-qwik/create-qwik.cjs playground {outputDir}` @@ -21,7 +21,7 @@ E2E project does the following internally: Note that provided folder should exist. If custom path is used, generated application will not be removed after the test completes, which is helpful for debugging. -2. Uses packed `@builder.io/qwik`, `@builder.io/qwik-city` and `eslint-plugin-qwik` packages to update package.json file of the generated application with `file:path-to-package.tgz`. +2. Uses packed `@qwik.dev/core`, `@qwik.dev/router` and `eslint-plugin-qwik` packages to update package.json file of the generated application with `file:path-to-package.tgz`. 3. Runs actual tests. Please pay attention at the `beforeAll` hook in the spec file @@ -48,4 +48,4 @@ Both `config.cleanupFn();` and `killAllRegisteredProcesses` there are extremely ## Adding new tests -Right now we have only one test file within this project. This means only one test application will be created and used, which is good from the execution time standpoint. If more files are added, it shouldn't potentially be a problem as we have `fileParallelism: false` set in the `vite.config.ts`, which means only one test will be executed at a time. This obviously slows down the execution time, but is safer, because we're working with a real file system. +Right now we have only one test file within this project. This means only one test application will be created and used, which is good from the execution time standpoint. If more files are added, it shouldn't potentially be a problem as we have `fileParallelism: false` set in the `vite.config.mts`, which means only one test will be executed at a time. This obviously slows down the execution time, but is safer, because we're working with a real file system. diff --git a/e2e/qwik-cli-e2e/package.json b/e2e/qwik-cli-e2e/package.json index db74902f146..b0a98646444 100644 --- a/e2e/qwik-cli-e2e/package.json +++ b/e2e/qwik-cli-e2e/package.json @@ -6,7 +6,7 @@ }, "private": true, "scripts": { - "e2e": "vitest run --config=vite.config.ts", - "e2e.watch": "vitest watch --config=vite.config.ts" + "e2e": "vitest run --config=vite.config.mts", + "e2e.watch": "vitest watch --config=vite.config.mts" } } diff --git a/e2e/qwik-cli-e2e/tests/serve.spec.ts b/e2e/qwik-cli-e2e/tests/serve.spec.ts index dce1518d60a..796f914ebfd 100644 --- a/e2e/qwik-cli-e2e/tests/serve.spec.ts +++ b/e2e/qwik-cli-e2e/tests/serve.spec.ts @@ -22,7 +22,6 @@ beforeEach(() => { for (const type of ['empty', 'playground'] as QwikProjectType[]) { describe(`template: ${type}`, () => { beforeAll(() => { - console.log('================================================ scaffolding', type); const config = scaffoldQwikProject(type); global.tmpDir = config.tmpDir; diff --git a/e2e/qwik-cli-e2e/utils/setup.ts b/e2e/qwik-cli-e2e/utils/setup.ts index 05e2fe18a85..84e8975c2fe 100644 --- a/e2e/qwik-cli-e2e/utils/setup.ts +++ b/e2e/qwik-cli-e2e/utils/setup.ts @@ -1,16 +1,16 @@ import { execSync } from 'child_process'; +import { existsSync, writeFileSync } from 'fs'; import { join } from 'path'; import { workspaceRoot } from '.'; -import { existsSync, writeFileSync } from 'fs'; const packageCfg = { - '@builder.io/qwik': { + '@qwik.dev/core': { packagePath: 'packages/qwik', distPath: 'packages/qwik/dist', }, - '@builder.io/qwik-city': { - packagePath: 'packages/qwik-city', - distPath: 'packages/qwik-city/lib', + '@qwik.dev/router': { + packagePath: 'packages/qwik-router', + distPath: 'packages/qwik-router/lib', }, 'eslint-plugin-qwik': { packagePath: 'packages/eslint-plugin-qwik', diff --git a/e2e/qwik-cli-e2e/vite.config.ts b/e2e/qwik-cli-e2e/vite.config.mts similarity index 100% rename from e2e/qwik-cli-e2e/vite.config.ts rename to e2e/qwik-cli-e2e/vite.config.mts diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 0ff0bdcfac2..00000000000 --- a/eslint.config.js +++ /dev/null @@ -1,112 +0,0 @@ -import globals from 'globals'; -import js from '@eslint/js'; -import tseslint from 'typescript-eslint'; -import noOnlyTests from 'eslint-plugin-no-only-tests'; -import { globalIgnores } from 'eslint/config'; -// import { qwikEslint9Plugin } from 'eslint-plugin-qwik'; - -const ignores = [ - '**/.history', - '**/.vscode', - '**/dist', - '**/dist-dev', - '**/lib', - '**/node_modules', - '**/tsc-out', - '**/external', - '**/*.', - '**/*.log', - '**/etc', - '**/target', - '**/temp', - '**/tsdoc-metadata.json', - '**/.DS_Store', - '**/*.mp4', - 'scripts', - '**/server/**/*.js', - '**/*.tsbuildinfo', - 'packages/docs/api', - 'packages/docs/public/repl/repl-sw.js*', - 'packages/docs/src/routes/examples/apps', - 'packages/docs/src/routes/playground/app', - 'packages/docs/src/routes/tutorial', - 'packages/qwik-labs/lib', - 'packages/qwik-labs/lib-types', - 'packages/qwik-labs/vite', - 'packages/insights/drizzle.config.ts', - 'packages/insights/panda.config.ts', - 'starters/apps/base', - 'starters/apps/library', - 'starters/templates', - '**/vite.config.ts', - // packages with eslint.config.mjs - 'packages/qwik-labs', - 'packages/insights', - 'starters', - // eslint.config.* - '**/eslint.config.mjs', - '**/eslint.config.js', -]; - -export default tseslint.config( - globalIgnores(ignores), - js.configs.recommended, - tseslint.configs.recommended, - // qwikEslint9Plugin.configs.recommended, - { - languageOptions: { - globals: { - ...globals.browser, - ...globals.node, - ...globals.es2021, - }, - parserOptions: { - // Needed when using the qwik plugin - // projectService: true, - // tsconfigRootDir: import.meta.dirname, - }, - }, - }, - { - plugins: { - 'no-only-tests': noOnlyTests, - }, - rules: { - 'no-only-tests/no-only-tests': 'error', - }, - name: 'no-only-tests', - }, - { - rules: { - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-inferrable-types': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - 'prefer-spread': 'off', - 'no-case-declarations': 'off', - 'no-console': ['error', { allow: ['warn', 'error'] }], - 'no-only-tests/no-only-tests': 'error', - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-var-requires': 'off', - curly: 'error', - 'no-new-func': 'error', - '@typescript-eslint/no-empty-object-type': 'off', - '@typescript-eslint/no-unused-expressions': 'off', - '@typescript-eslint/no-unsafe-function-type': 'off', - '@typescript-eslint/no-require-imports': 'off', - '@typescript-eslint/no-wrapper-object-types': 'off', - }, - }, - { - files: ['packages/docs/**/*.{ts,tsx}'], - rules: { - 'no-console': 'off', - }, - } -); diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000000..dcc4bcb7897 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,161 @@ +import globals from 'globals'; +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import noOnlyTests from 'eslint-plugin-no-only-tests'; +import { globalIgnores } from 'eslint/config'; +// import { qwikEslint9Plugin } from 'eslint-plugin-qwik'; + +const ignores = [ + '**/.history', + '**/.vscode', + '**/dist', + '**/dist-dev', + '**/lib', + '**/node_modules', + '**/tsc-out', + '**/external', + '**/*.', + '**/*.log', + '**/etc', + '**/target', + '**/temp', + '**/tsdoc-metadata.json', + '**/.DS_Store', + '**/*.mp4', + 'scripts', + '**/server/**/*.js', + '**/*.tsbuildinfo', + 'packages/docs/api', + 'packages/docs/public/repl/repl-sw.js*', + 'packages/docs/src/routes/examples/apps', + 'packages/docs/src/routes/playground/app', + 'packages/docs/src/routes/tutorial', + 'packages/qwik/src/optimizer/core/src/fixtures', + 'packages/qwik/bindings', + 'packages/qwik-labs/lib', + 'packages/qwik-labs/lib-types', + 'packages/qwik-labs/vite', + 'packages/insights/drizzle.config.ts', + 'packages/insights/panda.config.ts', + 'packages/qwik/src/napi', + 'starters/apps/base', + 'starters/apps/library', + 'starters/templates', + '**/vite.config.ts', + // packages with eslint.config.mjs + 'packages/qwik-labs', + 'packages/insights', + 'starters', + // eslint.config.* + '**/eslint.config.mjs', + '**/eslint.config.js', + '.changeset', + 'packages/docs/public/builder', +]; + +export default tseslint.config( + globalIgnores(ignores), + js.configs.recommended, + tseslint.configs.recommended, + // qwikEslint9Plugin.configs.recommended, + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + ...globals.es2021, + }, + parserOptions: { + // Needed when using the qwik plugin + // projectService: true, + // tsconfigRootDir: import.meta.dirname, + }, + }, + }, + { + plugins: { + 'no-only-tests': noOnlyTests, + }, + rules: { + 'no-only-tests/no-only-tests': 'error', + }, + name: 'no-only-tests', + }, + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-inferrable-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-this-alias': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + 'prefer-spread': 'off', + 'no-case-declarations': 'off', + 'no-console': ['error', { allow: ['warn', 'error'] }], + 'no-only-tests/no-only-tests': 'error', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-var-requires': 'off', + curly: 'error', + 'no-new-func': 'error', + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/no-require-imports': 'off', + '@typescript-eslint/no-wrapper-object-types': 'off', + }, + }, + { + files: ['packages/docs/**/*.{ts,tsx}'], + rules: { + 'no-console': 'off', + }, + }, + { + files: ['packages/qwik/src/server/**/*.ts'], + ignores: ['packages/qwik/src/server/qwik-copy.ts'], + rules: { + '@typescript-eslint/no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['packages/*'], + message: 'Absolute imports are not allowed.', + }, + { + group: ['../**'], + message: 'Relative imports are not allowed.', + }, + ], + }, + ], + 'no-duplicate-imports': 'error', + }, + }, + { + files: ['packages/qwik/src/server/qwik-types.ts'], + rules: { + '@typescript-eslint/no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['packages/*'], + message: 'Absolute imports are not allowed.', + allowTypeImports: true, + }, + { + group: ['../**'], + message: 'Relative imports are not allowed.', + allowTypeImports: true, + }, + ], + }, + ], + }, + } +); diff --git a/flake.nix b/flake.nix index e3c401a67d8..0c09246dc85 100644 --- a/flake.nix +++ b/flake.nix @@ -30,8 +30,8 @@ bashInteractive gitMinimal - nodejs_20 - corepack_20 + nodejs_22 + corepack_22 # Playwright for the end-to-end tests playwright-driver.browsers diff --git a/package.json b/package.json index dd1a52b305d..3dfb90e7613 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "qwik-monorepo", "version": "0.0.0-read-qwik-package-json", + "author": "Qwik Team", "comments": { - "01": "devDependencies includes reference to @builder.io/qwik: workspace: *. This is needed or e2e tests will fail", + "01": "devDependencies includes reference to @qwik.dev/core: workspace:*. This is needed or e2e tests will fail", "02": " It would be nice to be able to remove this dependency and fix the test.", - "03": "devDependencies can't include reference to @builder.io/qwik-city or e2e test will fail." + "03": "devDependencies can't include reference to @qwik.dev/router or e2e test will fail." }, "config": { "syncpack": { @@ -18,7 +19,7 @@ "dependencies": [ "vite" ], - "pinVersion": "^5" + "pinVersion": ">=5 <8" }, { "label": "use workspace protocol for local packages and allow patch versions (used in e.g. qwik-react)", @@ -39,7 +40,7 @@ "dependencyTypes": [ "dev" ], - "pinVersion": "workspace:^" + "pinVersion": "workspace:*" }, { "label": "Separate prod deps from dev deps", @@ -60,13 +61,6 @@ } ], "semverGroups": [ - { - "label": "Undici should always be * until we remove it", - "dependencies": [ - "undici" - ], - "range": "*" - }, { "label": "use exact version numbers for devDependencies", "dependencyTypes": [ @@ -77,30 +71,11 @@ ] } }, - "contributors": [ - { - "name": "Miško Hevery", - "email": "misko@hevery.com", - "url": "https://twitter.com/mhevery" - }, - { - "name": "Adam Bradley", - "email": "adam@builder.io", - "url": "https://twitter.com/adamdbradley" - }, - { - "name": "Manu Mtz.-Almeida", - "email": "manu@builder.io", - "url": "https://twitter.com/manucorporat" - } - ], "dependencies": { "esbuild-plugin-raw": "^0.1.8" }, "devDependencies": { - "@builder.io/qwik": "workspace:^", - "@builder.io/qwik-city": "workspace:^", - "@changesets/cli": "2.28.1", + "@changesets/cli": "2.29.3", "@changesets/get-github-info": "0.6.0", "@changesets/types": "6.1.0", "@clack/prompts": "0.7.0", @@ -113,12 +88,14 @@ "@node-rs/helper": "1.6.0", "@octokit/action": "6.1.0", "@playwright/test": "1.50.1", + "@qwik.dev/core": "workspace:*", "@qwik.dev/partytown": "0.11.1", + "@qwik.dev/router": "workspace:*", "@types/brotli": "1.3.4", "@types/bun": "1.1.6", "@types/cross-spawn": "6.0.6", "@types/express": "4.17.21", - "@types/node": "20.14.11", + "@types/node": "24.0.4", "@types/path-browserify": "1.0.2", "@types/prompts": "2.4.9", "@types/react": "18.3.3", @@ -126,16 +103,18 @@ "@types/tmp": "0.2.6", "@types/which-pm-runs": "1.0.2", "@vitejs/plugin-basic-ssl": "2.0.0", + "@vitest/coverage-v8": "3.2.4", "all-contributors-cli": "6.26.1", "brotli": "1.3.3", - "create-qwik": "workspace:^", + "create-qwik": "workspace:*", "cross-spawn": "7.0.3", "csstype": "3.1.3", "dotenv": "16.4.5", - "esbuild": "0.25.4", + "esbuild": "0.25.5", "eslint": "9.25.1", + "eslint-plugin-import": "2.29.1", "eslint-plugin-no-only-tests": "3.3.0", - "eslint-plugin-qwik": "workspace:^", + "eslint-plugin-qwik": "workspace:*", "execa": "8.0.1", "express": "4.20.0", "globals": "16.0.0", @@ -144,36 +123,35 @@ "monaco-editor": "0.45.0", "mri": "1.2.0", "path-browserify": "1.0.1", - "prettier": "3.3.3", - "prettier-plugin-jsdoc": "1.3.0", + "prettier": "3.5.3", + "prettier-plugin-jsdoc": "1.3.2", "pretty-quick": "4.0.0", "prompts": "2.4.2", - "rollup": "4.39.0", + "rollup": "4.44.0", "semver": "7.6.3", "simple-git-hooks": "2.11.1", "snoop": "1.0.4", "source-map": "0.7.4", "svgo": "3.3.2", "syncpack": "12.3.3", - "terser": "5.31.3", + "terser": "5.43.1", "tmp": "0.2.3", "tree-kill": "1.2.2", - "tsx": "4.19.1", - "typescript": "5.4.5", + "tsx": "4.19.2", + "typescript": "5.8.3", "typescript-eslint": "8.26.1", - "undici": "*", "vfile": "6.0.2", - "vite": "5.3.5", - "vite-imagetools": "7.0.4", - "vite-plugin-dts": "3.9.1", - "vite-tsconfig-paths": "4.3.2", - "vitest": "2.0.5", + "vite": "7.0.0", + "vite-imagetools": "7.1.0", + "vite-plugin-dts": "4.5.4", + "vite-tsconfig-paths": "5.1.4", + "vitest": "3.2.4", "watchlist": "0.3.1", "which-pm-runs": "1.1.0", "zod": "3.22.4" }, "engines": { - "node": ">=16.8.0 <18.0.0 || >=18.11", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", "npm": "please-use-pnpm", "yarn": "please-use-pnpm", "pnpm": ">=9.0.5" @@ -181,11 +159,13 @@ "packageManager": "pnpm@9.15.5", "pnpm": { "overrides": { - "typescript": "5.4.5", + "prettier": "3.5.3", + "typescript": "5.8.3", "vfile": "6.0.2" }, "patchedDependencies": { - "density-clustering@1.3.0": "patches/density-clustering@1.3.0.patch" + "density-clustering@1.3.0": "patches/density-clustering@1.3.0.patch", + "@auth/qwik": "patches/@auth__qwik.patch" } }, "private": true, @@ -196,20 +176,21 @@ "build.clean": "tsx ./scripts/build-clean.ts", "build.cli": "tsx --require ./scripts/runBefore.ts scripts/index.ts --cli --dev", "build.cli.prod": "tsx --require ./scripts/runBefore.ts scripts/index.ts --cli", - "build.core": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --qwikcity --api --platform-binding", + "build.core": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwik --insights --qwikrouter --api --platform-binding", + "build.router": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikrouter --api", "build.eslint": "tsx --require ./scripts/runBefore.ts scripts/index.ts --eslint", - "build.full": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding --wasm", - "build.local": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding-wasm-copy", - "build.only_javascript": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api", + "build.full": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --qwik --insights --supabaseauthhelpers --api --eslint --qwikrouter --qwikworker --qwikreact --cli --platform-binding --wasm", + "build.local": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --qwik --insights --supabaseauthhelpers --api --eslint --qwikrouter --qwikworker --qwikreact --cli --platform-binding-wasm-copy", + "build.only_javascript": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwik --api", "build.packages.docs": "pnpm -C ./packages/docs/ run build", "build.packages.insights": "pnpm -C ./packages/insights/ run build", "build.platform": "tsx --require ./scripts/runBefore.ts scripts/index.ts --platform-binding", "build.platform.copy": "tsx --require ./scripts/runBefore.ts scripts/index.ts --platform-binding-wasm-copy", - "build.qwik-city": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikcity", - "build.validate": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api --eslint --qwikcity --platform-binding --wasm --validate", - "build.vite": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api --qwikcity --eslint --platform-binding-wasm-copy", + "build.qwik-router": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikrouter", + "build.validate": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwik --api --eslint --qwikrouter --platform-binding --wasm --validate", + "build.vite": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwik --insights --api --qwikrouter --eslint --platform-binding-wasm-copy", "build.wasm": "tsx --require ./scripts/runBefore.ts scripts/index.ts --wasm", - "build.watch": "tsx --require ./scripts/runBefore.ts scripts/index.ts --build --qwikcity --watch --dev --platform-binding", + "build.watch": "tsx --require ./scripts/runBefore.ts scripts/index.ts --qwik --qwikrouter --watch --dev --platform-binding", "change": "changeset", "cli": "pnpm build.cli && node packages/create-qwik/create-qwik.cjs && tsx --require ./scripts/runBefore.ts scripts/validate-cli.ts --copy-local-qwik-dist", "cli.qwik": "pnpm build.cli && node packages/qwik/qwik-cli.cjs", @@ -221,9 +202,9 @@ "eslint.update": "tsx --require ./scripts/runBefore.ts scripts/eslint-docs.ts", "fmt": "pnpm prettier.fix && pnpm syncpack format", "fmt.staged": "pretty-quick --staged", - "link.dist": "cd packages/qwik && pnpm link --global && cd ../qwik-city && pnpm link --global && cd ../eslint-plugin-qwik && pnpm link --global && cd ../qwik-react && pnpm link --global", - "link.dist.npm": "cd packages/qwik && npm link && cd ../qwik-city && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link", - "link.dist.yarn": "cd packages/qwik && yarn link && cd ../qwik-city && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link", + "link.dist": "cd packages/qwik && pnpm link --global && cd ../qwik-router && pnpm link --global && cd ../eslint-plugin-qwik && pnpm link --global && cd ../qwik-react && pnpm link --global", + "link.dist.npm": "cd packages/qwik && npm link && cd ../qwik-router && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link", + "link.dist.yarn": "cd packages/qwik && yarn link && cd ../qwik-router && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link", "lint": "pnpm lint.eslint && pnpm lint.prettier && pnpm lint.rust", "lint.eslint": "eslint --cache \"**/*.ts*\" && pnpm -r --parallel lint", "lint.fix": "eslint --fix \"**/*.ts*\" && pnpm -r --parallel lint.fix && pnpm prettier.fix", @@ -236,7 +217,7 @@ "qwik-push-build-repos": "tsx --require ./scripts/runBefore.ts ./scripts/qwik-push-build-repos.ts", "release": "changeset publish", "release.fixup-package-json": "syncpack fix-mismatches --config syncpack-release-conf.json", - "release.pkg-pr-new": "pnpm dlx pkg-pr-new@^0.0.9 publish --compact --pnpm ./packages/qwik ./packages/qwik-city ./packages/eslint-plugin-qwik ./packages/create-qwik", + "release.pkg-pr-new": "pnpm dlx pkg-pr-new@^0.0.9 publish --pnpm ./packages/qwik ./packages/qwik-router ./packages/eslint-plugin-qwik ./packages/create-qwik", "release.prepare": "pnpm build --prepare-release", "serve": "tsx --require ./scripts/runBefore.ts --inspect --conditions=development starters/dev-server.ts 3300", "serve.debug": "tsx --require ./scripts/runBefore.ts --inspect-brk --conditions=development starters/dev-server.ts 3300", @@ -245,17 +226,19 @@ "test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit && test.e2e.integrations", "test.e2e.chromium": "playwright test starters --browser=chromium --config starters/playwright.config.ts", "test.e2e.chromium.debug": "PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts", - "test.e2e.city": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts", "test.e2e.cli": "pnpm --filter qwik-cli-e2e e2e", "test.e2e.firefox": "playwright test starters --browser=firefox --config starters/playwright.config.ts", "test.e2e.integrations.chromium": "playwright test e2e/adapters-e2e/tests --project=chromium --config e2e/adapters-e2e/playwright.config.ts", "test.e2e.integrations.webkit": "playwright test e2e/adapters-e2e/tests --project=webkit --config e2e/adapters-e2e/playwright.config.ts", + "test.e2e.router": "playwright test starters/e2e/qwikrouter --browser=chromium --config starters/playwright.config.ts", + "test.e2e.run": "tsm scripts/e2e-cli.ts", "test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts", "test.rust": "make test", + "test.rust.bench": "make benchmark", "test.rust.update": "make test-update", "test.unit": "vitest packages", "test.unit.debug": "vitest --inspect-brk packages", - "test.vite": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts", + "test.vite": "playwright test starters/e2e/qwikrouter --browser=chromium --config starters/playwright.config.ts", "tsc.check": "tsc --noEmit", "tsc.trace": "tsc -p tsconfig.json --traceResolution > tsc.log", "tsc.watch": "tsc --noEmit --watch --preserveWatchOutput", diff --git a/packages/create-qwik/CHANGELOG.md b/packages/create-qwik/CHANGELOG.md index a5a5bdaec59..21fb69c8609 100644 --- a/packages/create-qwik/CHANGELOG.md +++ b/packages/create-qwik/CHANGELOG.md @@ -1,5 +1,37 @@ # create-qwik +## 2.0.0-beta.5 + +## 2.0.0-beta.4 + +## 2.0.0-beta.3 + +## 2.0.0-beta.2 + +## 2.0.0-beta.1 + +## 2.0.0-alpha.10 + +## 2.0.0-alpha.9 + +## 2.0.0-alpha.8 + +## 2.0.0-alpha.7 + +## 2.0.0-alpha.6 + +## 2.0.0-alpha.5 + +## 2.0.0-alpha.4 + +## 2.0.0-alpha.3 + +## 2.0.0-alpha.2 + +## 2.0.0-alpha.1 + +## 2.0.0-alpha.0 + ## 1.14.1 ### Patch Changes @@ -58,4 +90,4 @@ - - built files are now under dist/ or lib/. All tools that respect package export maps should just work. (by [@wmertens](https://github.com/wmertens) in [#6715](https://github.com/QwikDev/qwik/pull/6715)) If you have trouble with Typescript, ensure that you use `moduleResolution: "Bundler"` in your `tsconfig.json`. - - `@builder.io/qwik` no longer depends on `undici` + - `@qwik.dev/core` no longer depends on `undici` diff --git a/packages/create-qwik/package.json b/packages/create-qwik/package.json index 19db8932c3c..e2d317cdef9 100644 --- a/packages/create-qwik/package.json +++ b/packages/create-qwik/package.json @@ -1,8 +1,8 @@ { "name": "create-qwik", "description": "Interactive CLI for create Qwik projects and adding features.", - "version": "1.14.1", - "author": "Builder.io Team", + "version": "2.0.0-beta.5", + "author": "Qwik Team", "bin": "./create-qwik.cjs", "bugs": "https://github.com/QwikDev/qwik/issues", "devDependencies": { @@ -25,7 +25,6 @@ ], "homepage": "https://qwik.dev/", "keywords": [ - "builder.io", "generator", "qwik", "starters", diff --git a/packages/docs/adapters/cloudflare-pages/vite.config.mts b/packages/docs/adapters/cloudflare-pages/vite.config.mts deleted file mode 100644 index 7629ebc667c..00000000000 --- a/packages/docs/adapters/cloudflare-pages/vite.config.mts +++ /dev/null @@ -1,27 +0,0 @@ -import { cloudflarePagesAdapter } from '@builder.io/qwik-city/adapters/cloudflare-pages/vite'; -import { extendConfig } from '@builder.io/qwik-city/vite'; -// @ts-ignore -import baseConfig from '../../vite.config.mts'; - -export default extendConfig(baseConfig, () => { - return { - build: { - ssr: true, - rollupOptions: { - input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'], - }, - minify: false, - }, - plugins: [ - cloudflarePagesAdapter({ - ssg: { - include: ['/', '/*'], - exclude: ['/demo/*', '/shop/*'], - origin: - (process.env.CF_PAGES_BRANCH !== 'main' ? process.env.CF_PAGES_URL : null) ?? - 'https://qwik.builder.io', - }, - }), - ], - }; -}); diff --git a/packages/docs/adapters/cloudflare-pages/vite.config.ts b/packages/docs/adapters/cloudflare-pages/vite.config.ts new file mode 100644 index 00000000000..09178a42746 --- /dev/null +++ b/packages/docs/adapters/cloudflare-pages/vite.config.ts @@ -0,0 +1,26 @@ +import { cloudflarePagesAdapter } from '@qwik.dev/router/adapters/cloudflare-pages/vite'; +import { extendConfig } from '@qwik.dev/router/vite'; +import baseConfig from '../../vite.config'; + +export default extendConfig(baseConfig, () => { + return { + build: { + ssr: true, + rollupOptions: { + input: ['src/entry.cloudflare-pages.tsx'], + }, + minify: false, + }, + plugins: [ + cloudflarePagesAdapter({ + ssg: { + include: ['/', '/*'], + exclude: ['/demo/*', '/shop/*'], + origin: + (process.env.CF_PAGES_BRANCH !== 'main' ? process.env.CF_PAGES_URL : null) ?? + 'https://qwik.dev', + }, + }), + ], + }; +}); diff --git a/packages/docs/check-qwik-build.ts b/packages/docs/check-qwik-build.ts index 69ec5771c56..42c4ffa153d 100644 --- a/packages/docs/check-qwik-build.ts +++ b/packages/docs/check-qwik-build.ts @@ -5,8 +5,9 @@ import fs from 'node:fs'; import path from 'node:path'; import { spawnSync } from 'node:child_process'; +import { fileURLToPath } from 'url'; -let __dirname = path.dirname(new URL(import.meta.url).pathname); +let __dirname = path.dirname(fileURLToPath(import.meta.url)); const isWindows = process.platform === 'win32'; if (isWindows && __dirname.startsWith('/')) { // in Windows __dirname starts with a / causing errors @@ -18,7 +19,7 @@ if (isWindows && __dirname.startsWith('/')) { } const qwikPkgDir = path.join(__dirname, '..', 'qwik', 'dist'); -if (!fs.existsSync(path.join(qwikPkgDir, 'core.d.ts'))) { +if (!fs.existsSync(path.join(qwikPkgDir, 'core-internal.d.ts'))) { console.warn( `\n\n=== Running 'pnpm run build.local' to generate missing imports for the docs ===\n` ); diff --git a/packages/docs/contributors.ts b/packages/docs/contributors.ts index 6b91e2726ae..4932f381804 100644 --- a/packages/docs/contributors.ts +++ b/packages/docs/contributors.ts @@ -1,4 +1,3 @@ -import { fetch } from 'undici'; import fs from 'node:fs'; import path from 'node:path'; import url from 'node:url'; diff --git a/packages/docs/package.json b/packages/docs/package.json index 414162aec5b..4a4d38d5bd8 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -2,15 +2,12 @@ "name": "qwik-docs", "description": "Qwik Docs Site", "version": "0.0.1", - "author": "Builder.io Team", + "author": "Qwik Team", "bugs": "https://github.com/QwikDev/qwik", "devDependencies": { "@algolia/autocomplete-core": "1.7.4", "@algolia/client-search": "4.14.3", - "@builder.io/qwik": "workspace:^", - "@builder.io/qwik-city": "workspace:^", - "@builder.io/qwik-labs": "workspace:^", - "@builder.io/qwik-react": "workspace:^", + "@builder.io/qwik": "1.14.1", "@emotion/react": "11.13.0", "@emotion/styled": "11.13.0", "@modular-forms/qwik": "0.23.1", @@ -18,7 +15,10 @@ "@mui/system": "5.16.4", "@mui/x-data-grid": "6.20.4", "@qwik-ui/headless": "0.6.7", + "@qwik.dev/core": "workspace:*", "@qwik.dev/partytown": "0.11.1", + "@qwik.dev/react": "workspace:*", + "@qwik.dev/router": "workspace:*", "@shikijs/colorized-brackets": "3.1.0", "@shikijs/rehype": "3.1.0", "@shikijs/transformers": "3.1.0", @@ -37,28 +37,28 @@ "leaflet": "1.9.4", "magic-string": "0.30.11", "openai": "3.3.0", - "prettier": "3.3.3", + "prettier": "3.5.3", "prism-themes": "1.9.0", "prismjs": "1.29.0", "puppeteer": "22.13.1", - "qwik-image": "0.0.10", + "qwik-image": "0.0.16", "react": "18.3.1", "react-dom": "18.3.1", "shiki": "3.1.0", "snarkdown": "2.0.0", "tailwindcss": "4.0.12", - "terser": "5.31.3", + "terser": "5.43.1", "tsm": "2.3.0", - "typescript": "5.4.5", + "typescript": "5.8.3", "undici": "*", "valibot": "0.33.3", - "vite": "5.3.5", + "vite": "7.0.0", "vite-plugin-inspect": "0.8.5", - "vite-tsconfig-paths": "4.3.2", + "vite-tsconfig-paths": "5.1.4", "wrangler": "3.65.1" }, "engines": { - "node": ">=18.11", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", "npm": "please-use-pnpm", "yarn": "please-use-pnpm", "pnpm": ">=8.6.12" @@ -67,11 +67,11 @@ "license": "MIT", "private": true, "scripts": { - "build": "qwik build", + "build": "pnpm build.repl-sw && qwik build", "build.client": "vite build", "build.preview": "NODE_OPTIONS=--max-old-space-size=8192 vite build --ssr src/entry.preview.tsx", - "build.repl-sw": "vite --config vite.config-repl-sw.mts build", - "build.server": "NODE_OPTIONS=--max-old-space-size=8192 vite build -c adapters/cloudflare-pages/vite.config.mts", + "build.repl-sw": "vite --config vite.config-repl-sw build", + "build.server": "NODE_OPTIONS=--max-old-space-size=8192 vite build -c adapters/cloudflare-pages/vite.config", "build.showcase": "pnpm node scripts/showcase.js", "codesandbox.sync": "tsx codesandbox.sync.ts", "contributors": "tsx contributors.ts", @@ -83,5 +83,6 @@ "preview.only": "NODE_DEBUG=net,http node --inspect-brk ../../node_modules/vite/bin/vite.js preview", "preview.wrangler": "wrangler pages dev ./dist --compatibility-flags=nodejs_als", "start": "pnpm dev" - } + }, + "type": "module" } diff --git a/packages/docs/public/_redirects b/packages/docs/public/_redirects index ddc89bbb39f..8c9ff564bc0 100644 --- a/packages/docs/public/_redirects +++ b/packages/docs/public/_redirects @@ -31,6 +31,7 @@ /qwikcity/routing/route-parameters/ /docs/routing/ 308 /qwikcity/routing/error-responses/ /docs/advanced/routing/ 308 /qwikcity/loader/ /docs/route-loader/ 308 +/qwikcity/adaptors/ /docs/deployments/ 308 /qwikcity/layout/overview/ /docs/layout/ 308 /qwikcity/layout/nested/ /docs/advanced/routing/ 308 /qwikcity/layout/grouped/ /docs/advanced/routing/ 308 @@ -62,10 +63,14 @@ /docs/components/resource/ /docs/components/state/ 308 /docs/cookbook/re-exporting-loaders/ /docs/re-exporting-loaders/ 308 +/qwikcity/adaptors/* /docs/deployments/:splat 308 /qwikcity/* /docs/:splat 308 +/qwikrouter/* /docs/:splat 308 /integrations/* /docs/integrations/:splat 308 /deployments/* /docs/deployments/:splat 308 /docs/advanced/i18n/ /docs/integrations/i18n/ 308 /docs/components/inline-components/ /docs/components/overview/ 308 /docs/think-qwik/ /docs/concepts/think-qwik/ 308 +/docs/qwikcity/ /docs/qwikrouter/ 308 +/docs/qwikcity-deprecated-features/ /docs/qwikrouter-deprecated-features/ 308 /docs/env-variables/ /docs/guides/env-variables/ 308 diff --git a/packages/docs/public/_routes.json b/packages/docs/public/_routes.json index f93db4d2d78..bf9f46f8f49 100644 --- a/packages/docs/public/_routes.json +++ b/packages/docs/public/_routes.json @@ -1,23 +1,12 @@ { "version": 1, - "include": ["/*"], + "include": ["/playground/*", "/tutorial/*", "/demo/*"], "exclude": [ - "/chat", - "/examples", - "/guide", - "/tutorial", - "/tutorials", - "/tutorial/hooks/use-client-effect/", - "/docs/overview/", - "/docs/cheat/qwik-react/", - "/docs/cheat/best-practices/", - "/docs/cheat/serialization/", - "/docs/components/lifecycle/", - "/docs/components/projection/", - "/docs/components/resource/", - "/qwikcity/*", - "/integrations/*", - "/deployments/*", - "/repl/*" + "/assets/*", + "/build/*", + "/favicon.ico", + "/manifest.json", + "/robots.txt", + "/service-worker.js" ] } diff --git a/packages/docs/public/docs/qwikcity/README.md b/packages/docs/public/docs/qwikcity/README.md deleted file mode 100644 index 551c630592f..00000000000 --- a/packages/docs/public/docs/qwikcity/README.md +++ /dev/null @@ -1 +0,0 @@ -The images in this folder were created: https://docs.google.com/presentation/d/1HjlWpOpnPAmjdxEV7F2uttjvkWf1FOLvXaWMcxGLs38/ diff --git a/packages/docs/public/icons/qwikCity_and_routing.svg b/packages/docs/public/icons/qwikRouter_and_routing.svg similarity index 100% rename from packages/docs/public/icons/qwikCity_and_routing.svg rename to packages/docs/public/icons/qwikRouter_and_routing.svg diff --git a/packages/docs/scripts/showcase.js b/packages/docs/scripts/showcase.js index cb6f24ec73f..d5c5528f4a5 100644 --- a/packages/docs/scripts/showcase.js +++ b/packages/docs/scripts/showcase.js @@ -145,7 +145,6 @@ async function captureMultipleScreenshots() { } async function getPagespeedData(url) { - const { fetch } = await import('undici'); const requestURL = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${encodeURIComponent( url )}&key=AIzaSyApBC9gblaCzWrtEBgHnZkd_B37OF49BfM&category=PERFORMANCE&strategy=MOBILE`; diff --git a/packages/docs/src/components/code-block/code-block.tsx b/packages/docs/src/components/code-block/code-block.tsx index 8743318e556..ff6fbaf7600 100644 --- a/packages/docs/src/components/code-block/code-block.tsx +++ b/packages/docs/src/components/code-block/code-block.tsx @@ -1,4 +1,4 @@ -import { component$, useStyles$, type QRL, useVisibleTask$, useSignal } from '@builder.io/qwik'; +import { component$, useStyles$, type QRL, useVisibleTask$, useSignal } from '@qwik.dev/core'; import prismjs from 'prismjs'; // Set to global so that prism language plugins can find it. const _global = @@ -15,7 +15,7 @@ import styles from './code-block.css?inline'; import { CopyCode } from '../copy-code/copy-code-block'; interface CodeBlockProps { path?: string; - language?: 'markup' | 'css' | 'javascript' | 'json' | 'jsx' | 'tsx'; + language?: 'markup' | 'css' | 'javascript' | 'json' | 'jsx' | 'tsx' | 'clike'; code: string; pathInView$?: QRL<(name: string) => void>; observerRootId?: string; diff --git a/packages/docs/src/components/code-sandbox/index.tsx b/packages/docs/src/components/code-sandbox/index.tsx index 23f4f82ccb6..1f13741b1a5 100644 --- a/packages/docs/src/components/code-sandbox/index.tsx +++ b/packages/docs/src/components/code-sandbox/index.tsx @@ -1,7 +1,7 @@ -import { component$, useContext, useStylesScoped$, Slot, useSignal } from '@builder.io/qwik'; -import CSS from './index.css?inline'; +import { component$, Slot, useContext, useSignal, useStylesScoped$ } from '@qwik.dev/core'; import { GlobalStore } from '../../context'; import { EditIcon } from '../svgs/edit-icon'; +import CSS from './index.css?inline'; export default component$<{ src?: string; @@ -96,7 +96,7 @@ function examplePath( } = typeof opts === 'string' ? ({ path: opts } as any) : opts; const newPath = path .replace('/(qwik)/', '/') - .replace('/(qwikcity)/', '/') + .replace('/(qwikrouter)/', '/') .replace('/src/routes/demo', '/demo') .replace(/\/[\w\d]+\.tsx?$/, '/'); diff --git a/packages/docs/src/components/content-nav/content-nav.tsx b/packages/docs/src/components/content-nav/content-nav.tsx index a8ba45639ee..87f1c6ac5bd 100644 --- a/packages/docs/src/components/content-nav/content-nav.tsx +++ b/packages/docs/src/components/content-nav/content-nav.tsx @@ -1,5 +1,5 @@ -import { type ContentMenu, useContent, useLocation } from '@builder.io/qwik-city'; -import { component$, useStyles$ } from '@builder.io/qwik'; +import { component$, useStyles$ } from '@qwik.dev/core'; +import { type ContentMenu, useContent, useLocation } from '@qwik.dev/router'; import styles from './content-nav.css?inline'; export const ContentNav = component$(() => { diff --git a/packages/docs/src/components/contributors/index.tsx b/packages/docs/src/components/contributors/index.tsx index b204a76ac93..1c8d3fc7ad2 100644 --- a/packages/docs/src/components/contributors/index.tsx +++ b/packages/docs/src/components/contributors/index.tsx @@ -1,6 +1,6 @@ -import { component$, useStylesScoped$ } from '@builder.io/qwik'; +import { component$, useStylesScoped$ } from '@qwik.dev/core'; +import { useDocumentHead } from '@qwik.dev/router'; import styles from './contributors.css?inline'; -import { useDocumentHead } from '@builder.io/qwik-city'; export default component$(() => { useStylesScoped$(styles); diff --git a/packages/docs/src/components/copy-code/copy-code-block.tsx b/packages/docs/src/components/copy-code/copy-code-block.tsx index 905f3f27f94..c3f9231c157 100644 --- a/packages/docs/src/components/copy-code/copy-code-block.tsx +++ b/packages/docs/src/components/copy-code/copy-code-block.tsx @@ -1,4 +1,4 @@ -import { component$, useSignal, useStyles$ } from '@builder.io/qwik'; +import { component$, useSignal, useStyles$ } from '@qwik.dev/core'; import { CopyCode as CopyCodeIcon } from '../svgs/copy-code-icon'; import styles from './copy-code.css?inline'; diff --git a/packages/docs/src/components/docsearch/algolia-logo.tsx b/packages/docs/src/components/docsearch/algolia-logo.tsx index 01ad2eec853..3fb4f9012c4 100644 --- a/packages/docs/src/components/docsearch/algolia-logo.tsx +++ b/packages/docs/src/components/docsearch/algolia-logo.tsx @@ -1,4 +1,4 @@ -import { component$ } from '@builder.io/qwik'; +import { component$ } from '@qwik.dev/core'; type AlgoliaLogoTranslations = Partial<{ searchByText: string; diff --git a/packages/docs/src/components/docsearch/context.ts b/packages/docs/src/components/docsearch/context.ts index 06d9e061cbd..9aebd4792ba 100644 --- a/packages/docs/src/components/docsearch/context.ts +++ b/packages/docs/src/components/docsearch/context.ts @@ -1,3 +1,3 @@ -import { createContextId } from '@builder.io/qwik'; +import { createContextId } from '@qwik.dev/core'; export const SearchContext = createContextId- No Reported Diagnostics -
) : ( [...store.diagnostics, ...store.monacoDiagnostics].map((d, key) => ( diff --git a/packages/docs/src/repl/repl-output-segments.tsx b/packages/docs/src/repl/repl-output-segments.tsx new file mode 100644 index 00000000000..544cf5c109a --- /dev/null +++ b/packages/docs/src/repl/repl-output-segments.tsx @@ -0,0 +1,73 @@ +import { $, component$, useSignal } from '@qwik.dev/core'; +import type { TransformModule } from '@qwik.dev/core/optimizer'; +import { CodeBlock } from '../components/code-block/code-block'; +const FILE_MODULE_DIV_ID = 'file-modules-symbol'; + +export const ReplOutputSegments = component$(({ outputs }: ReplOutputSegmentsProps) => { + const selectedPath = useSignal(outputs.length ? outputs[0].path : ''); + const pathInView$ = $((path: string) => { + selectedPath.value = path; + }); + + return ( +{o.segment!.paramNames.join(', ')}
+ {o.segment!.captureNames.join(', ')}
+ Hello Qwik
;\n});\n`, @@ -125,6 +134,13 @@ export const createPlaygroundShareUrl = (data: PlaygroundShareUrl, pathname = '/ if (data.entryStrategy !== dataDefaults.entryStrategy) { params.set('entryStrategy', data.entryStrategy); } + if (data.preloader !== dataDefaults.preloader) { + if (data.preloader) { + params.set('preloader', ''); + } else { + params.delete('preloader'); + } + } params.set('f', compressFiles(data.files)); @@ -180,4 +196,5 @@ interface PlaygroundShareUrl { buildMode: any; entryStrategy: any; files: any[]; + preloader?: boolean; } diff --git a/packages/docs/src/repl/repl-share-url.unit.ts b/packages/docs/src/repl/repl-share-url.unit.ts index 6d1dec380bc..0a04205690d 100644 --- a/packages/docs/src/repl/repl-share-url.unit.ts +++ b/packages/docs/src/repl/repl-share-url.unit.ts @@ -1,13 +1,14 @@ -import { assert, test } from 'vitest'; +import { strFromU8 } from 'fflate'; +import { assert, expect, test } from 'vitest'; import { - filesToStr, - strToFiles, - createPlaygroundShareUrl, compressFiles, - parseCompressedFiles, + createPlaygroundShareUrl, dictionary, + filesToStr, + parseCompressedFiles, + parsePlaygroundShareUrl, + strToFiles, } from './repl-share-url'; -import { strFromU8 } from 'fflate'; const data = { version: '1.2.3', @@ -23,6 +24,7 @@ const data = { code: 'console.log("bar");', }, ], + preloader: false, }; test('filesToStr', () => { assert.equal( @@ -64,8 +66,85 @@ test('createPlaygroundShareUrl 2', () => { }); test('dictionary is unchanged', () => { - assert.equal( - strFromU8(dictionary), - "0||1448|Hello Qwik
;\n});\n|17|/entry.server.tsx|201|import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n return renderToString(Hello Qwik
; + }); + |17|/entry.server.tsx|201|import { renderToString, type RenderOptions } from '@builder.io/qwik/server'; + import { Root } from './root'; + + export default function (opts: RenderOptions) { + return renderToString(Hello Qwik
;\n});\n", + }), + ]) + ); + expect( + parsePlaygroundShareUrl( + 'f=Q0o0xgaW2BKNDrDkqNCB15QUpyFIgKTl51uBeGA%2BKO%2BBIwaW0W1A6SI%2FDWQzyKm1wKBDVwyU0lAqUNJRqE4GFc3AqLNSCnENDlGq1QTpAGJ43a5RDa6oa0FOgBsDbxkAXQIMCqAWMIktXqqBSvRgNoNMRg7C0XQ%2FJNM9AA' + ) + ).toHaveProperty( + 'files', + // DO NOT UPDATE THIS TEST - all these URLs must work forever + expect.arrayContaining([ + expect.objectContaining({ + path: '/app.tsx', + code: `import { component$, jsx, useTask$ } from '@builder.io/qwik'; + +export default component$(() => { + const foo:{ + contents: ReturnType