Skip to content

Commit

Permalink
Merge branch 'main' into feat/dotnotation-field-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gioboa committed Jun 22, 2024
2 parents 8ea9715 + 1d7f808 commit 71a1216
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 185 deletions.
42 changes: 9 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ jobs:
path: packages/eslint-plugin-qwik/dist/
if-no-files-found: error

- name: Publish packages for testing
run: pnpm dlx pkg-pr-new@0.0.8 publish --compact --pnpm ./packages/qwik/dist ./packages/qwik-city/lib ./packages/eslint-plugin-qwik/dist ./packages/create-qwik/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

############ BUILD WASM #############
build-wasm:
name: Build WASM
Expand Down Expand Up @@ -398,6 +393,7 @@ jobs:
build-distribution:
name: Build Distribution
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.fullbuild == 'true' }}

needs:
- build-package
Expand All @@ -409,84 +405,67 @@ jobs:

steps:
- name: Checkout
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/checkout@v4.1.1

- uses: pnpm/action-setup@v4
if: ${{ needs.changes.outputs.fullbuild == 'true' }}

- name: Setup Node
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
cache: 'pnpm'
registry-url: https://registry.npmjs.org/

- run: corepack enable
if: ${{ needs.changes.outputs.fullbuild == 'true' }}

- name: Install NPM Dependencies
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: |
# Ensure that the qwik binary gets made
mkdir -p packages/qwik/dist/bindings/
pnpm install --frozen-lockfile
- name: Download Build Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/download-artifact@v4.1.2

- name: Print Distribution Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: tree dist-dev-builder-io-qwik/

- name: Move Distribution Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: mv dist-dev-builder-io-qwik/* packages/qwik/dist/

- name: Print Bindings Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: tree dist-bindings-*/

- name: Move Binding Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: mv dist-bindings-*/* packages/qwik/dist/bindings/

- name: Print Packages Dist Build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: tree packages/qwik/dist/

- name: Upload Qwik Distribution Artifact
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/upload-artifact@v4.3.1
with:
name: builderio-qwik-distribution
path: packages/qwik/dist/*
if-no-files-found: error

- name: Build QwikCity / QwikLabs
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: pnpm tsm scripts/index.ts --tsc --qwikcity --qwiklabs --api --eslint

- name: Print QwikCity Lib Build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: tree packages/qwik-city/lib/

- name: Upload QwikCity Build Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/upload-artifact@v4.3.1
with:
name: builderio-qwikcity-distribution
path: packages/qwik-city/lib/
if-no-files-found: error

- name: Print QwikLabs Lib Build
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: tree packages/qwik-labs/lib/ packages/qwik-labs/vite/

- name: Upload QwikLabs Build Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/upload-artifact@v4.3.1
with:
name: builderio-qwiklabs-distribution
Expand Down Expand Up @@ -563,6 +542,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish packages for testing
if: ${{ github.event_name != 'workflow_dispatch' }}
run: pnpm dlx pkg-pr-new@^0.0.9 publish --compact --pnpm ./packages/qwik/dist ./packages/qwik-city/lib ./packages/eslint-plugin-qwik/dist ./packages/create-qwik/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
if: ${{ github.event_name == 'workflow_dispatch' }}
run: pnpm tsm scripts/index.ts --set-dist-tag="${{ github.event.inputs.disttag }}" --validate --release
Expand All @@ -576,6 +561,7 @@ jobs:
needs:
- build-distribution
- changes
if: ${{ needs.changes.outputs.fullbuild == 'true' }}

strategy:
matrix:
Expand All @@ -591,30 +577,24 @@ jobs:

steps:
- name: Checkout
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/checkout@v4.1.1

- uses: pnpm/action-setup@v4
if: ${{ needs.changes.outputs.fullbuild == 'true' }}

- name: Setup Node ${{ matrix.settings.node }}
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.settings.node }}
cache: 'pnpm'
registry-url: https://registry.npmjs.org/

- if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: corepack enable
- run: corepack enable
shell: bash

- name: Download Build Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
uses: actions/download-artifact@v4.1.2

- name: Move Distribution Artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: |
mkdir -p packages/qwik/dist/
mv builderio-qwik-distribution/* packages/qwik/dist/
Expand All @@ -626,22 +606,18 @@ jobs:
mv dist-dev-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/
- name: Install NPM Dependencies
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: |
# Ensure that the qwik binary gets made
mkdir -p packages/qwik/dist/bindings/
pnpm install --frozen-lockfile
- name: Install Playwright
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: npx playwright install ${{ matrix.settings.browser }} --with-deps

- name: Playwright E2E Tests
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: pnpm run test.e2e.${{ matrix.settings.browser }} --timeout 60000 --retries 3 --workers 1

- name: Validate Create Qwik Cli
if: ${{ needs.changes.outputs.fullbuild == 'true' }}
run: pnpm cli.validate

############ UNIT TEST ############
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/routes/api/qwik/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@
}
],
"kind": "Function",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nLoad the prefetch graph for the container.\n\nEach Qwik container needs to include its own prefetch graph.\n\n\n```typescript\nPrefetchGraph: (opts?: {\n base?: string;\n manifestHash?: string;\n manifestURL?: string;\n nonce?: string;\n}) => JSXNode<\"script\">\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; manifestHash?: string; manifestURL?: string; nonce?: string; }\n\n\n</td><td>\n\n_(Optional)_ Options for the loading prefetch graph.\n\n- `base` - Base of the graph. For a default installation this will default to `/build/`<!-- -->. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - `manifestHash` - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute `q:manifest-hash` and assume the default build file `${base}/q-bundle-graph-${manifestHash}.json`<!-- -->. - `manifestURL` - URL of the manifest file to load if non-standard bundle graph location name.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\nJSXNode&lt;\"script\"&gt;",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nLoad the prefetch graph for the container.\n\nEach Qwik container needs to include its own prefetch graph.\n\n\n```typescript\nPrefetchGraph: (opts?: {\n base?: string;\n manifestHash?: string;\n manifestURL?: string;\n nonce?: string;\n}) => JSXNode<\"script\">\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; manifestHash?: string; manifestURL?: string; nonce?: string; }\n\n\n</td><td>\n\n_(Optional)_ Options for the loading prefetch graph.\n\n- `base` - Base of the graph. For a default installation this will default to the q:base value `/build/`<!-- -->. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - `manifestHash` - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute `q:manifest-hash` and assume the default build file `${base}/q-bundle-graph-${manifestHash}.json`<!-- -->. - `manifestURL` - URL of the manifest file to load if non-standard bundle graph location name.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\n[JSXNode](#jsxnode)<!-- -->&lt;\"script\"&gt;",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts",
"mdFile": "qwik.prefetchgraph.md"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/routes/api/qwik/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3619,7 +3619,7 @@ opts
_(Optional)_ Options for the loading prefetch graph.
- `base` - Base of the graph. For a default installation this will default to `/build/`. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - `manifestHash` - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute `q:manifest-hash` and assume the default build file `${base}/q-bundle-graph-${manifestHash}.json`. - `manifestURL` - URL of the manifest file to load if non-standard bundle graph location name.
- `base` - Base of the graph. For a default installation this will default to the q:base value `/build/`. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - `manifestHash` - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute `q:manifest-hash` and assume the default build file `${base}/q-bundle-graph-${manifestHash}.json`. - `manifestURL` - URL of the manifest file to load if non-standard bundle graph location name.
</td></tr>
</tbody></table>
Expand Down
1 change: 0 additions & 1 deletion packages/qwik/src/core/platform/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const createPlatform = (): CorePlatform => {
const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();
const urlCopy = new URL(urlDoc);
urlCopy.hash = '';
urlCopy.search = '';
const importURL = urlCopy.href;
return import(/* @vite-ignore */ importURL).then((mod) => {
return mod[symbolName];
Expand Down
10 changes: 10 additions & 0 deletions packages/qwik/src/core/qrl/qrl.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ describe('serialization', () => {
$symbol$: 'symbol',
$capture$: ['2'],
});
matchProps(
parseQRL(
'/src/path%2d/foo_symbol.js?_qrl_parent=/home/user/project/src/path/foo.js#symbol[2]'
),
{
$chunk$: '/src/path%2d/foo_symbol.js?_qrl_parent=/home/user/project/src/path/foo.js',
$symbol$: 'symbol',
$capture$: ['2'],
}
);
});

test('serialize qrls', () => {
Expand Down
33 changes: 6 additions & 27 deletions packages/qwik/src/optimizer/core/src/entry_strategy.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::transform::HookData;
use crate::{parse::PathData, transform::HookKind};
use path_slash::PathBufExt;
use crate::transform::HookKind;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use swc_atoms::JsWord;
Expand All @@ -27,7 +26,6 @@ pub trait EntryPolicy: Send + Sync {
fn get_entry_for_sym(
&self,
hash: &str,
location: &PathData,
context: &[String],
hook_data: &HookData,
) -> Option<JsWord>;
Expand All @@ -40,7 +38,6 @@ impl EntryPolicy for InlineStrategy {
fn get_entry_for_sym(
&self,
_hash: &str,
_path: &PathData,
_context: &[String],
_hook_data: &HookData,
) -> Option<JsWord> {
Expand All @@ -63,7 +60,6 @@ impl EntryPolicy for SingleStrategy {
fn get_entry_for_sym(
&self,
hash: &str,
_path: &PathData,
_context: &[String],
_hook_data: &HookData,
) -> Option<JsWord> {
Expand Down Expand Up @@ -92,7 +88,6 @@ impl EntryPolicy for PerHookStrategy {
fn get_entry_for_sym(
&self,
hash: &str,
_path: &PathData,
_context: &[String],
_hook_data: &HookData,
) -> Option<JsWord> {
Expand Down Expand Up @@ -121,9 +116,8 @@ impl EntryPolicy for PerComponentStrategy {
fn get_entry_for_sym(
&self,
hash: &str,
_path: &PathData,
context: &[String],
_hook_data: &HookData,
hook_data: &HookData,
) -> Option<JsWord> {
if let Some(map) = &self.map {
let entry = map.get(hash);
Expand All @@ -133,15 +127,7 @@ impl EntryPolicy for PerComponentStrategy {
}
context.first().map_or_else(
|| Some(ENTRY_HOOKS.clone()),
|root| {
Some(JsWord::from(
_path
.rel_dir
.join(["entry_", root].concat())
.to_slash_lossy()
.as_ref(),
))
},
|root| Some(JsWord::from([&hook_data.origin, "_entry_", root].concat())),
)
}
}
Expand All @@ -160,7 +146,6 @@ impl EntryPolicy for SmartStrategy {
fn get_entry_for_sym(
&self,
hash: &str,
_path: &PathData,
context: &[String],
hook_data: &HookData,
) -> Option<JsWord> {
Expand All @@ -181,16 +166,10 @@ impl EntryPolicy for SmartStrategy {
// This means that all QRLs for a component are loaded together
// if one is used
context.first().map_or_else(
// Top-level QRLs are put into a separate file
|| None,
|root| {
Some(JsWord::from(
_path
.rel_dir
.join(["entry_", root].concat())
.to_slash_lossy()
.as_ref(),
))
},
// Other QRLs are put into a file named after the original file + the root component
|root| Some(JsWord::from([&hook_data.origin, "_entry_", root].concat())),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export default component$(() => {

import { componentQrl } from "@builder.io/qwik";
import { qrl } from "@builder.io/qwik";
export default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import("../../../../src/routes/_repl/[id]/entry_[[...slug]].js"), "slug_component_0AM8HPnkNs4"));
export default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import("../../../../src/routes/_repl/[id]/[[...slug]].tsx_entry_[[...slug]].js"), "slug_component_0AM8HPnkNs4"));


Some("{\"version\":3,\"sources\":[\"/user/qwik/src/src/routes/_repl/[id]/[[...slug]].tsx\"],\"names\":[],\"mappings\":\";;AAIA,6BAAe,oIAKZ\"}")
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/src/routes/_repl/[id]/[[...slug]].tsx\"],\"names\":[],\"mappings\":\";;AAIA,6BAAe,oJAKZ\"}")
============================= src/routes/_repl/[id]/slug_component_div_onclick_xevvy0qc7pa.js (ENTRY POINT)==

import { sibling } from "./sibling";
Expand Down Expand Up @@ -68,7 +68,7 @@ Some("{\"version\":3,\"sources\":[\"/user/qwik/src/src/routes/_repl/[id]/[[...sl
{
"origin": "src/routes/_repl/[id]/[[...slug]].tsx",
"name": "slug_component_0AM8HPnkNs4",
"entry": "src/routes/_repl/[id]/entry_[[...slug]]",
"entry": "src/routes/_repl/[id]/[[...slug]].tsx_entry_[[...slug]]",
"displayName": "slug_component",
"hash": "0AM8HPnkNs4",
"canonicalFilename": "slug_component_0am8hpnkns4",
Expand All @@ -84,7 +84,7 @@ Some("{\"version\":3,\"sources\":[\"/user/qwik/src/src/routes/_repl/[id]/[[...sl
]
}
*/
============================= src/routes/_repl/[id]/entry_[[...slug]].js (ENTRY POINT)==
============================= src/routes/_repl/[id]/[[...slug]].tsx_entry_[[...slug]].js (ENTRY POINT)==

export { slug_component_0AM8HPnkNs4 } from "./slug_component_0am8hpnkns4.js";

Expand Down
Loading

0 comments on commit 71a1216

Please sign in to comment.