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

feat(framework/vue): framework support for Vue.js #464

Merged
merged 15 commits into from
May 10, 2022
Merged

feat(framework/vue): framework support for Vue.js #464

merged 15 commits into from
May 10, 2022

Conversation

linbingquan
Copy link
Contributor

@linbingquan linbingquan commented May 3, 2022

Related issue: #461

TODO

  • support the framework routing
  • useData hook
  • Head component
  • Link component

@ije
Copy link
Member

ije commented May 4, 2022

Hi, this looks great! i already implemented the vue sfc loader, now we need to implement the framework part.

there are a couple of things we need to add:

  • <App>/<Router> support the fs routing
  • useData hook to allow fetch server data
  • <Head> component for SEO meta
  • <Link>/<NavLink> component to link between pages in the client
<!-- ./routes/index.vue -->

<script>
// this will be striped in client
export const data = {
  get: () => {
    return new Response(JSON.stringify({ ... }))
  }
}
</script>

<script setup>
import { Head, Link, useData } from "aleph/vue"
const { data } = await useData()
</script>

<template>
  <Head>
    <title>Page</title>
  </Head>
  <p>Page data: {{ data }}</p>
  <Link to="/blog">Blog</Link>
</template>

@linbingquan
Copy link
Contributor Author

@ije Thank you for your reply, I think I was done with Link and Router feature, it can work. TBH, I am not 100% sure I was done those.

@@ -30,6 +32,19 @@ deno task start examples/react-app
deno task build examples/react-app
```

### vue-app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

framework/vue/data.ts Outdated Show resolved Hide resolved
framework/vue/router.ts Outdated Show resolved Hide resolved
@ije
Copy link
Member

ije commented May 6, 2022

Screen Shot 2022-05-06 at 21 16 48

nice, you have good taste!

@linbingquan
Copy link
Contributor Author

linbingquan commented May 6, 2022

I found framework/react and framework/vue render same view in different brower, it does not support multiple client user (Chinese English), it means framework doesn't have session user, maybe it can call some terminology, but I don't know. TBH, I am not good at SSR enough. I am not sure it's easily to support, whether it should be supported.

@ije
Copy link
Member

ije commented May 6, 2022

I found framework/react and framework/vue render same view in different brower, it does not support multiple client user (Chinese English), it means framework doesn't have session user, maybe it can call some terminology, but I don't know. TBH, I am not good at SSR enough. I am not sure it's easily to support, whether it should be supported.

check https://dash.deno.com, it is built by aleph/react, support session/i18n is not hard although, i will add an auth middleware later

@linbingquan
Copy link
Contributor Author

linbingquan commented May 6, 2022

@ije I found your code with more detail, like <Link />/<NavLink />, I am not sure this PR can be approval. I just can coding what I can understand with your code of framework/react... Can you tell me what should I do by next step.

@linbingquan
Copy link
Contributor Author

linbingquan commented May 6, 2022

check https://dash.deno.com, it is built by aleph/react, support session/i18n is not hard although, i will add an auth middleware later

Thank you for your reply. I was wonder how it works deno deploy by what framework, awesome aleph/react.

@ije ije mentioned this pull request May 7, 2022
2 tasks
@linbingquan
Copy link
Contributor Author

linbingquan commented May 7, 2022

I think this PR can be review, I want to refactor https://bing-wallpaper.deno.dev after this PR merge, it will be testting.

@linbingquan linbingquan marked this pull request as ready for review May 7, 2022 23:34
@linbingquan linbingquan changed the title wip(framework/vue): it can work. feat(framework/vue): framework support for Vue.js May 7, 2022
@ije
Copy link
Member

ije commented May 8, 2022

@linbingquan 👍 great job! i will look into it, thanks

framework/vue/link.ts Outdated Show resolved Hide resolved
@ije
Copy link
Member

ije commented May 8, 2022

the deploy build testing was failed, i will look into it

@linbingquan
Copy link
Contributor Author

linbingquan commented May 8, 2022

the deploy build testing was failed, i will look into it

OK, I was try to found the error for Aleph.js CI / Deploy (aleph-vue, examples/vue-app) , but I can not resolve it...

@ije
Copy link
Member

ije commented May 10, 2022

@linbingquan i'm going to merge this pr, you done this vary well! congratulations! 🎉

@ije
Copy link
Member

ije commented May 10, 2022

i will fix the build issue later, please keep improving the vue framework if you have time

@ije ije merged commit e974bc5 into alephjs:main May 10, 2022
@linbingquan linbingquan deleted the dev-vue branch May 11, 2022 04:50
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.

2 participants