Skip to content

Conversation

@KapilSachdev
Copy link

@KapilSachdev KapilSachdev commented Oct 29, 2025

  • Upgrade dependencies to Vue 3, vue-loader 17, element-plus and vue-i18n in package.json
  • Update public HTML files to use Vue 3 and Element Plus CDN builds.
  • Keep el-switch height as 20px to match previous design from Element UI.
  • Migrate app bootstrap to Vue 3 API: use createApp and createI18n in src/main.js and register ElementPlus.
  • Replace vue-scrollactive with a new in-house ScrollSpy component
  • Auto formatting by prettier.
  • Update build config to import VueLoaderPlugin from 'vue-loader'.
Component Image
Explore ExploreComponent
ExampleCard LightModeExampleChart DarkModeExampleChart
Preview/Editor Preview
View/Preview View
CodeAce CodeAce
CodeMonaco image
Editor image
FullCodePreview image

- Upgrade dependencies to Vue 3, vue-loader 17, element-plus and vue-i18n in package.json
- Update public HTML files to use Vue 3 and Element Plus CDN builds.
- Keep el-switch height as 20px to match previous design from Element UI.
- Migrate app bootstrap to Vue 3 API: use createApp and createI18n in src/main.js and register ElementPlus.
- Replace vue-scrollactive with a new in-house ScrollSpy component
- Auto formatting by prettier.
- Update build config to import VueLoaderPlugin from 'vue-loader'.
- Updated example prop to use defineProps as destructured reactive prop
- Use store as reactive entity
- Use useTemplateRef for left container
- Use store as reactive shared state.
- Initialize LazyLoad as a ref and update lazy-loading logic accordingly.
- Update i18n $t with t
- Change Element plus mini size to small as mini is removed
- Pass raw store via vue toRaw to fix clone issue with proxy objects as store is reactive
@KapilSachdev KapilSachdev marked this pull request as ready for review November 1, 2025 13:20
@KapilSachdev KapilSachdev marked this pull request as draft November 1, 2025 18:45
- When moving from element-ui to element plus, we lost the built-in icon font. Element plus has icon library which is Vue specific. To avoid dependency, we are switching to an SVG sprite approach for icons as we only need a few icons.
- Integrate an in-house SvgSpritePlugin into build/webpack.config.js
  - Special handling for svg icons loading (include iconDir, support ?inline)
- Add UI icon SVGs in use
- update components to use sprite <svg><use href="/asset/sprite.svg#...">
@KapilSachdev KapilSachdev marked this pull request as ready for review November 3, 2025 05:15
@KapilSachdev KapilSachdev marked this pull request as draft November 6, 2025 19:49
@KapilSachdev
Copy link
Author

Turns out the build process is a bit different. Examples are copied to website but the HTML and some dependency come from apache/echarts-www

After building localsite via apache/echarts-www, error from vue-i18n popped up only for production build. All works well in dev server mode.

Getting syntax error from below code of vue-i18n :
https://github.com/intlify/vue-i18n/blob/4786d3db1c4a24ee86716d59a74433d99710a2dc/packages/vue-i18n-core/src/i18n.ts#L712-L718

Another non-blocker issue is that SVGs are being duplicated in final build.
SVG process in webpack is changed to remove element-ui icon dependency and rather adding another dependency for icons, it was better to have in-house svg as there are not much, so sprite was added. Currently this seems to require a bit more cleaning.

- VueI18n raises ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined in production build
- Add missing ElementPlus import in main as we now use it as devDependency
- Migrate all SVGs to be compiled into a sprite and used via <use> tags with symbol IDs.
- Add utility CSS classes for consistent SVG styling, addressing <use> shadow DOM behavior.
- Refactor Sidebar SVGs to use the sprite-based approach instead of CommonJS require.
- Move inline SVGs to separate files in the icon/ui folder for better organization.
@KapilSachdev
Copy link
Author

Documentation vue upgrade - apache/echarts-doc#486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant