Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have any plans to support vue3? #137

Open
nsano-rururu opened this issue Nov 28, 2021 · 26 comments
Open

Do you have any plans to support vue3? #137

nsano-rururu opened this issue Nov 28, 2021 · 26 comments

Comments

@nsano-rururu
Copy link
Contributor

No description provided.

@fritx
Copy link
Owner

fritx commented Dec 17, 2021

@nsano-rururu yes, I did, any work or help is appreciated!

@PaulSaveur
Copy link

Hi, some news about vue 3 compatibility ??

@XIwen-chuan
Copy link

@fritx Is there a version that supports VUE3 or is it under development?

@nsano-rururu
Copy link
Contributor Author

@XIwen-chuan

It seems that vue3 support hasn't done anything yet.
I think the following actions are necessary.

  • Migrating From JavaScript to TypeScript

    • Add ESLint
  • Migrating From Webpack to Vite

  • Vue 3 Support

    • element-ui to element-plus
    • vuetify 2.x to 3.x

@XIwen-chuan
Copy link

@nsano-rururu thank you. this project is unique and useful. looking forward to supporting vue3

@fritx fritx self-assigned this Aug 3, 2022
@fritx
Copy link
Owner

fritx commented Aug 3, 2022

@nsano-rururu @XIwen-chuan now I'm trying with this guide:

Vue 3 Migration Build: safely upgrade your app to Vue 3 (Pt. 1)
https://www.vuemastery.com/blog/vue-3-migration-build/

@nsano-rururu

This comment was marked as off-topic.

fritx added a commit that referenced this issue Aug 3, 2022
fritx added a commit that referenced this issue Aug 3, 2022
@fritx
Copy link
Owner

fritx commented Aug 3, 2022

@nsano-rururu yes, agreed, but eslint is now off-topic right now.
Let's deal with vue3 first

I've just pushed the wip branch above
https://github.com/fritx/vue-at/commits/wip-vue3

...where I've worked out several errors except this one (failing to insert styled tag into editor):

[Vue warn]: Missing ref owner context. ref cannot be used on hoisted vnodes.
A vnode with ref must be created inside the render function. 

image

Official guide I was following:
https://v3-migration.vuejs.org/migration-build.html#preparations

@nsano-rururu
Copy link
Contributor Author

nsano-rururu commented Aug 3, 2022

@fritx

It's not irrelevant as eslint will tell you where you need vue3 compatibility with warnings and errors.

I would appreciate it if you could consider it as information that there is such a thing. There is no compulsion to adopt or not.

@fritx
Copy link
Owner

fritx commented Aug 8, 2022

eslint is done! And now it seems to work. Checkout it out, pls wip-vue3

Any interest in contributing to PR that switches to vite ? @nsano-rururu @XIwen-chuan @PaulSaveur

fritx added a commit that referenced this issue Aug 8, 2022
…sted vnodes. -- #137

seems could not use `:ref="xxx"` not more here
@XIwen-chuan
Copy link

Yes,my pleasure

@fritx
Copy link
Owner

fritx commented Aug 9, 2022

Here are some updates on vue3 support:

Switching to vue-demi

  • use vue-demi to keep one single codebase demo

Switching to vite -- branch: vite

Release

  • npm publish vue-at@3.0.0-alpha.2
  • npm publish vue-at@3.0.0

Some other related work by community

@nsano-rururu
Copy link
Contributor Author

@fritx @XIwen-chuan

I've tried it locally so far. I don't know how to fix existing vue-cli commands to vite commands.

.eslintrc.js

add

    eqeqeq: 'off',
    'no-tabs': 'off',

index.html

add 「<script type="module" src="/src/main.js"></script>」

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>vue-at</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="dist/demo.js"></script>
    <script type="module" src="/src/main.js"></script>
</body>
</html>

[new]vite.config.js

import { defineConfig } from 'vite'
import path from 'path'
import envCompatible from 'vite-plugin-env-compatible'
import { createHtmlPlugin } from 'vite-plugin-html'
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: [
      {
        find: /^~/,
        replacement: ''
      },
      {
        find: '@',
        replacement: path.resolve(__dirname, 'src')
      }
    ],
    extensions: [
      '.mjs',
      '.js',
      '.ts',
      '.jsx',
      '.tsx',
      '.json',
      '.vue'
    ]
  },
  plugins: [
    vue(),
    viteCommonjs(),
    envCompatible(),
    createHtmlPlugin({
      inject: {
        data: {
          title: 'vue-at'
        }
      }
    })
  ],
  css: {
    preprocessorOptions: {
      sass: {},
      scss: {}
    }
  },
  build: {}
})

package.json

add

"prepublish": "npm run build",
"serve-vite": "vite",
"build-vite": "vite build",
"preview-vite": "vite preview"

"@vitejs/plugin-vue": "^3.0.1",
"@originjs/vite-plugin-commonjs": "^1.0.1",
"vite": "^3.0.1",
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-html": "3.2.0",

{
  "name": "vue-at",
  "description": "At.js for Vue",
  "version": "3.0.0-alpha.0",
  "author": "Fritz Lin <uxfritz@163.com>",
  "repository": "https://github.com/fritx/vue-at",
  "scripts": {
    "lint:fix": "vue-cli-service lint",
    "lint": "vue-cli-service lint --no-fix",
    "dev:dist": "vue-cli-service serve --skip-plugins eslint",
    "dev": "vue-cli-service serve",
    "build:at": "vue-cli-service build ./src/At.vue --target lib --name vue-at",
    "build:at-ta": "vue-cli-service build ./src/AtTextarea.vue --target lib --name vue-at-textarea",
    "build": "rimraf dist && run-p build:at build:at-ta && rimraf dist/demo.html",
    "prepublish": "npm run build",
    "serve-vite": "vite",
    "build-vite": "vite build",
    "preview-vite": "vite preview"
  },
  "main": "dist/vue-at.common.js",
  "engines": {
    "node": ">= 14.x"
  },
  "dependencies": {
    "@vitejs/plugin-vue": "^3.0.1",
    "textarea-caret": "^3.1.0"
  },
  "peerDependencies": {
    "vue": "3.x"
  },
  "devDependencies": {
    "@babel/core": "^7.18.9",
    "@originjs/vite-plugin-commonjs": "^1.0.1",
    "@vue/cli-plugin-eslint": "^5.0.8",
    "@vue/cli-service": "^5.0.8",
    "@vue/compat": "^3.1.0",
    "@vue/compiler-sfc": "^3.1.0",
    "@vue/eslint-config-standard": "^8.0.1",
    "element-plus": "^2.2.12",
    "eslint": "^8.21.0",
    "eslint-plugin-vue": "^9.3.0",
    "npm-run-all": "^4.1.5",
    "rimraf": "^3.0.2",
    "sass": "^1.53.0",
    "sass-loader": "^13.0.2",
    "vite": "^3.0.1",
    "vite-plugin-env-compatible": "^1.1.1",
    "vite-plugin-html": "3.2.0",
    "vue": "^3.1.0",
    "vue-loader": "^16.0.0",
    "webpack": "^5.73.0"
  }
}

@fritx
Copy link
Owner

fritx commented Aug 9, 2022

@nsano-rururu cool, I'll take a look later

Also see #137 (comment)
Check my branch out, it seems to work now: wip-vite

@nsano-rururu
Copy link
Contributor Author

@fritx

There is no problem other than eslint errors.

[CORP\sano@a-19f9vs8e9ite4 vue-at]$ npm run lint

> vue-at@3.0.0-alpha.0 lint
> eslint --ext .js,.vue --ignore-path .gitignore src


/home/sano/dkwork3/e/vue-at/src/util.js
   8:22  error  Expected '===' and instead saw '=='  eqeqeq
  14:27  error  Unexpected tab character             no-tabs
  15:21  error  Unexpected tab character             no-tabs
  19:20  error  Expected '===' and instead saw '=='  eqeqeq
  25:26  error  Expected '!==' and instead saw '!='  eqeqeq

✖ 5 problems (5 errors, 0 warnings)

@fritx
Copy link
Owner

fritx commented Aug 11, 2022

@nsano-rururu ah that's fixed. and 3.0.0-alpha.0 was already released.

npm i -S vue-at@3.0.0-alpha.2
# or
npm i -S vue-at@next 

demo: https://github.com/we-demo/vue-at-vite-app

progress: #137 (comment)

@fritx
Copy link
Owner

fritx commented Sep 4, 2022

@nsano-rururu i'm not sure how to still support babel es2015-safe build via vite, any idea?

#137 (comment)

@nsano-rururu
Copy link
Contributor Author

Sounds like you need to look into babel-preset-env options.
https://babeljs.io/docs/en/env/

@nsano-rururu
Copy link
Contributor Author

babel-preset-env seems to transpile everything to ES5 notation if no options are specified.

@fritx
Copy link
Owner

fritx commented Sep 4, 2022

@nsano-rururu but i could not manage to make babel work well with vite (library mode) 😢
vitejs/vite#1639

@nsano-rururu
Copy link
Contributor Author

@fritx
Isn't it better not to move to vite yet?.
I think it's better to migrate to vite after a solution is found.

@nsano-rururu
Copy link
Contributor Author

@fritx
It seems that the stable version of vuetify3 compatible with vue3 has been released
https://github.com/vuetifyjs/vuetify/releases/tag/v3.0.0

@fritx fritx added fixed and removed in-progress labels Nov 29, 2022
@junaidshad
Copy link

What is the update on this?
we're receiving webpack issues on "vue-at@next" branch (upgrading while migration: using compat build)
image

@fritx
Copy link
Owner

fritx commented Mar 20, 2023

@junaidshad try vue-at@latest first. Is there a minimal demo?

@fritx
Copy link
Owner

fritx commented Mar 20, 2023

@junaidshad also try the umd way, it can be a fallback solution
https://github.com/fritx/vue-at/blob/vue3/test_umd.html
https://github.com/fritx/vue-at/tree/vue3#umd-also-supported

@junaidshad
Copy link

@fritx
Yes, It worked the umd way.

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

No branches or pull requests

5 participants