Skip to content

v2.8.2#1672

Merged
hexqi merged 2 commits intoopentiny:release/v2.8.xfrom
chilingling:fix/preview-custom-import-mapv28
Oct 14, 2025
Merged

v2.8.2#1672
hexqi merged 2 commits intoopentiny:release/v2.8.xfrom
chilingling:fix/preview-custom-import-mapv28

Conversation

@chilingling
Copy link
Member

@chilingling chilingling commented Oct 13, 2025

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Preview import map now supports custom mappings from configuration, enabling per-dependency CDN/domain/version/file-delimiter overrides with safe fallbacks.
  • Chores

    • Bumped package versions to 2.8.2 across the suite (core, demo, mock server, plugins, toolbars, settings, utils, generators, and more) with no functional changes.

@github-actions github-actions bot added ignore-for-release release merge to release/ branch, before release period labels Oct 13, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Walkthrough

Patch-level release update to 2.8.2 across multiple packages and templates. One code change modifies import map resolution in design-core preview to optionally use a custom import map from engine config, adjusting placeholder replacement logic and call sites accordingly.

Changes

Cohort / File(s) Summary
Design-core preview import map logic
packages/design-core/src/preview/src/preview/importMap.js
Adds custom import map support via getMergeMeta('engine.config')?.importMap; updates replacePlaceholder(v, k) and call sites to use per-entry overrides with existing fallbacks.
Core package version bumps
packages/block-compiler/package.json, packages/canvas/package.json, packages/common/package.json, packages/configurator/package.json, packages/design-core/package.json, packages/i18n/package.json, packages/layout/package.json, packages/register/package.json, packages/utils/package.json, packages/vue-generator/package.json, packages/webcomponent/package.json
Bump version 2.8.1 → 2.8.2. No other changes.
Build tooling version bumps
packages/build/vite-config/package.json, packages/build/vite-plugin-meta-comments/package.json
Bump version 2.8.1 → 2.8.2. No other changes.
CLI and template adjustments
packages/engine-cli/package.json, packages/engine-cli/template/designer/package.json
CLI version bumped to 2.8.2; template dependency ranges updated from ^2.8.1 to ^2.8.2 for engine packages.
Builtin components and UI assets
packages/builtinComponent/package.json, packages/svgs/package.json, packages/theme/base/package.json
Version bumps 2.8.1 → 2.8.2. No other changes.
Plugins version bumps
packages/plugins/*/package.json (block, bridge, datasource, help, i18n, materials, page, robot, schema, script, state, tree, tutorial)`
Version bumps 2.8.1 → 2.8.2 across listed plugins. No other changes.
Toolbars version bumps
packages/toolbars/*/package.json (breadcrumb, clean, collaboration, fullscreen, generate-code, lang, lock, logo, media, preview, redoundo, refresh, save, setting, themeSwitch, view-setting)`
Version bumps 2.8.1 → 2.8.2 across listed toolbars. No other changes.
Settings packages version bumps
packages/settings/design/package.json, packages/settings/events/package.json, packages/settings/panel/package.json, packages/settings/props/package.json, packages/settings/styles/package.json
Version bumps 2.8.1 → 2.8.2. No other changes.
Demos and mock server
designer-demo/package.json, mockServer/package.json
Version bumps 2.8.1 → 2.8.2. No other changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Preview as Preview UI
  participant ImportMap as ImportMapResolver
  participant Meta as MetaRegister
  participant CDN as CDN Placeholders

  Preview->>ImportMap: getImportMap()
  ImportMap->>Meta: getMergeMeta('engine.config')
  Meta-->>ImportMap: engine.config (may include importMap)
  alt custom importMap provided
    loop for each (k, v) in imports
      ImportMap->>ImportMap: replacePlaceholder(v, k) using customImportMap.imports[k]
    end
  else no custom map
    loop for each (k, v) in imports
      ImportMap->>CDN: apply VITE_CDN_DOMAIN, versionDelimiter, fileDelimiter, opentinyVueVersion
    end
  end
  ImportMap-->>Preview: resolved import map
  Note over ImportMap,Preview: Falls back to existing placeholders when no per-key override exists.
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • v2.8.1 #1668 — Prior coordinated version bump (2.8.0 → 2.8.1) across the same packages.
  • v2.7.4 #1667 — Similar widespread package.json version updates pattern.
  • v2.4.1 #1334 — Batch version field updates across many identical package manifests.

Suggested labels

chore

Suggested reviewers

  • hexqi

Poem

Patch hops forward, two-eight-two,
I twitch my nose at versions new.
A custom map for imports, neat—
Keys get carrots, fallbacks sweet.
Burrow built, releases true;
Thump the ground—our work is through! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title “v2.8.2” is too generic and does not convey the primary intent of the changeset, which includes adding support for a custom import map in the preview module alongside the version bump. It fails to highlight the most important functional change and is effectively a placeholder rather than a descriptive summary. Please update the pull request title to a concise sentence that reflects the main change, for example “Support custom import maps in preview and bump version to v2.8.2.”
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6448af0 and 9c06aba.

📒 Files selected for processing (55)
  • designer-demo/package.json (1 hunks)
  • mockServer/package.json (1 hunks)
  • packages/block-compiler/package.json (1 hunks)
  • packages/build/vite-config/package.json (1 hunks)
  • packages/build/vite-plugin-meta-comments/package.json (1 hunks)
  • packages/builtinComponent/package.json (1 hunks)
  • packages/canvas/package.json (1 hunks)
  • packages/common/package.json (1 hunks)
  • packages/configurator/package.json (1 hunks)
  • packages/design-core/package.json (1 hunks)
  • packages/design-core/src/preview/src/preview/importMap.js (3 hunks)
  • packages/engine-cli/package.json (1 hunks)
  • packages/engine-cli/template/designer/package.json (2 hunks)
  • packages/i18n/package.json (1 hunks)
  • packages/layout/package.json (1 hunks)
  • packages/plugins/block/package.json (1 hunks)
  • packages/plugins/bridge/package.json (1 hunks)
  • packages/plugins/datasource/package.json (1 hunks)
  • packages/plugins/help/package.json (1 hunks)
  • packages/plugins/i18n/package.json (1 hunks)
  • packages/plugins/materials/package.json (1 hunks)
  • packages/plugins/page/package.json (1 hunks)
  • packages/plugins/robot/package.json (1 hunks)
  • packages/plugins/schema/package.json (1 hunks)
  • packages/plugins/script/package.json (1 hunks)
  • packages/plugins/state/package.json (1 hunks)
  • packages/plugins/tree/package.json (1 hunks)
  • packages/plugins/tutorial/package.json (1 hunks)
  • packages/register/package.json (1 hunks)
  • packages/settings/design/package.json (1 hunks)
  • packages/settings/events/package.json (1 hunks)
  • packages/settings/panel/package.json (1 hunks)
  • packages/settings/props/package.json (1 hunks)
  • packages/settings/styles/package.json (1 hunks)
  • packages/svgs/package.json (1 hunks)
  • packages/theme/base/package.json (1 hunks)
  • packages/toolbars/breadcrumb/package.json (1 hunks)
  • packages/toolbars/clean/package.json (1 hunks)
  • packages/toolbars/collaboration/package.json (1 hunks)
  • packages/toolbars/fullscreen/package.json (1 hunks)
  • packages/toolbars/generate-code/package.json (1 hunks)
  • packages/toolbars/lang/package.json (1 hunks)
  • packages/toolbars/lock/package.json (1 hunks)
  • packages/toolbars/logo/package.json (1 hunks)
  • packages/toolbars/media/package.json (1 hunks)
  • packages/toolbars/preview/package.json (1 hunks)
  • packages/toolbars/redoundo/package.json (1 hunks)
  • packages/toolbars/refresh/package.json (1 hunks)
  • packages/toolbars/save/package.json (1 hunks)
  • packages/toolbars/setting/package.json (1 hunks)
  • packages/toolbars/themeSwitch/package.json (1 hunks)
  • packages/toolbars/view-setting/package.json (1 hunks)
  • packages/utils/package.json (1 hunks)
  • packages/vue-generator/package.json (1 hunks)
  • packages/webcomponent/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-14T05:53:28.501Z
Learnt from: gene9831
PR: opentiny/tiny-engine#917
File: docs/开始/快速上手.md:31-31
Timestamp: 2024-12-14T05:53:28.501Z
Learning: The latest stable version of `opentiny/tiny-engine-cli` is `2.0.0`, and documentation should reference this version instead of any release candidates.

Applied to files:

  • packages/register/package.json
  • packages/build/vite-config/package.json
  • packages/settings/events/package.json
  • packages/toolbars/generate-code/package.json
  • packages/plugins/page/package.json
  • packages/block-compiler/package.json
  • packages/vue-generator/package.json
  • packages/plugins/script/package.json
  • packages/canvas/package.json
  • packages/webcomponent/package.json
  • packages/plugins/schema/package.json
  • packages/plugins/tree/package.json
  • packages/toolbars/breadcrumb/package.json
  • packages/svgs/package.json
  • packages/layout/package.json
  • packages/plugins/help/package.json
  • packages/toolbars/logo/package.json
  • packages/toolbars/clean/package.json
  • packages/plugins/state/package.json
  • packages/i18n/package.json
  • packages/plugins/i18n/package.json
  • packages/common/package.json
  • packages/engine-cli/package.json
  • packages/plugins/bridge/package.json
  • packages/plugins/tutorial/package.json
  • packages/settings/props/package.json
  • packages/utils/package.json
  • packages/builtinComponent/package.json
  • packages/plugins/block/package.json
  • packages/plugins/robot/package.json
  • packages/theme/base/package.json
  • mockServer/package.json
  • packages/configurator/package.json
  • packages/design-core/package.json
  • packages/plugins/materials/package.json
  • packages/settings/styles/package.json
  • packages/settings/design/package.json
📚 Learning: 2024-09-30T07:51:10.036Z
Learnt from: chilingling
PR: opentiny/tiny-engine#837
File: packages/vue-generator/src/plugins/genDependenciesPlugin.js:66-66
Timestamp: 2024-09-30T07:51:10.036Z
Learning: In the `tiny-engine` project, `opentiny/tiny-engine-dsl-vue` refers to the current package itself, and importing types from it may cause circular dependencies.

Applied to files:

  • packages/vue-generator/package.json
  • packages/engine-cli/template/designer/package.json
🧬 Code graph analysis (1)
packages/design-core/src/preview/src/preview/importMap.js (3)
packages/build/vite-config/src/localCdnFile/copyPreviewImportMap.js (1)
  • importMap (17-17)
packages/register/src/common.ts (1)
  • getMergeMeta (53-55)
packages/design-core/src/preview/src/preview/srcFiles.js (2)
  • versionDelimiter (30-30)
  • fileDelimiter (31-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: push-check
🔇 Additional comments (8)
packages/plugins/state/package.json (1)

3-3: Version bump looks consistent with release v2.8.2.
Nothing else changed in this package manifest; all good.

packages/plugins/bridge/package.json (1)

3-3: Version bump looks good.

Nothing else changed; ready to ship.

packages/toolbars/lang/package.json (1)

3-3: Patch version bump looks good.

Version updated to 2.8.2 in line with the 2.8.x release stream. No further concerns.

packages/settings/props/package.json (1)

3-3: LGTM! Routine version bump.

The patch-level version bump from 2.8.1 to 2.8.2 is consistent with the PR's release update. No functional changes.

packages/theme/base/package.json (1)

3-3: LGTM! Routine version bump.

The patch-level version bump from 2.8.1 to 2.8.2 is consistent with the PR's release update. No functional changes.

packages/design-core/src/preview/src/preview/importMap.js (3)

13-13: LGTM! Appropriate API usage.

The addition of getMergeMeta from @opentiny/tiny-engine-meta-register is correct and aligns with the package's documented configurator APIs. Based on learnings


20-46: Verify: Custom import map lacks ${opentinyVueVersion} placeholder support.

The function signature change and custom import map logic are sound, but there's a placeholder inconsistency:

  • Custom import map (lines 35-38): supports ${VITE_CDN_DOMAIN}, ${versionDelimiter}, ${fileDelimiter}
  • Default fallback (lines 42-45): supports all of the above plus ${opentinyVueVersion}

If users expect to use ${opentinyVueVersion} in their custom import map entries, it won't be replaced and will remain as a literal string. This could break imports.

Is this omission intentional? If not, consider adding the placeholder replacement:

  if (customImportMap?.imports?.[k]) {
    return customImportMap.imports[k]
      .replace('${VITE_CDN_DOMAIN}', cdnDomain)
+     .replace('${opentinyVueVersion}', opentinyVueVersion)
      .replace('${versionDelimiter}', versionDelimiter)
      .replace('${fileDelimiter}', fileDelimiter)
  }

48-52: LGTM! Call site correctly updated.

The getImportMap function now correctly passes the key k to replacePlaceholder, enabling per-entry custom import map resolution. The logic preserves the mapping structure and allows the scripts parameter to override entries as before.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hexqi hexqi merged commit de9ef61 into opentiny:release/v2.8.x Oct 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release release merge to release/ branch, before release period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants