├── .github
└── FUNDING.yml
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── cypress-javascript.json
├── cypress-typescript.json
├── e2e
├── javascript
│ └── index.test.js
└── typescript
│ └── index.test.ts
├── images
└── screenshot.png
├── index.html
├── package-lock.json
├── package.json
├── public
├── .nojekyll
├── favicon.ico
└── logo.png
├── sandbox.config.json
├── src
├── javascript
│ ├── App.vue
│ ├── at-sign.js
│ ├── components
│ │ ├── AsyncPayment.js
│ │ ├── Cart.vue
│ │ ├── Checkout.vue
│ │ ├── Coupon.test.js
│ │ ├── Coupon.vue
│ │ ├── Exchange.vue
│ │ ├── Header.vue
│ │ ├── Item.vue
│ │ ├── Payment.jsx
│ │ ├── Spinner.js
│ │ ├── Username.test.js
│ │ └── Username.vue
│ ├── custom-element.js
│ ├── hooks.js
│ ├── main.js
│ ├── router.js
│ ├── store.js
│ └── version.js
└── typescript
│ ├── App.vue
│ ├── at-sign.ts
│ ├── components
│ ├── AsyncPayment.ts
│ ├── Cart.vue
│ ├── Checkout.vue
│ ├── Coupon.test.ts
│ ├── Coupon.vue
│ ├── Exchange.vue
│ ├── Header.vue
│ ├── Item.vue
│ ├── Payment.tsx
│ ├── Spinner.ts
│ ├── Username.test.ts
│ └── Username.vue
│ ├── hooks.ts
│ ├── main.ts
│ ├── router.ts
│ ├── sfc.d.ts
│ ├── store.ts
│ └── version.ts
├── tsconfig.json
├── vite.config.js
└── vitest.config.js
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: blacksonic
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: blacksonic
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "14"
4 | script: npm test
5 | before_deploy: npm run build
6 | deploy:
7 | provider: pages
8 | local_dir: dist
9 | skip_cleanup: true
10 | github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
11 | keep_history: true
12 | on:
13 | branch: master
14 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at soos.gabor86@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Issues
4 |
5 | Issues are very valuable to this project.
6 |
7 | * Ideas are a valuable source of contributions others can make
8 | * Problems show where this project is lacking
9 | * With a question you show where contributors can improve the user experience
10 |
11 | Thank you for creating them.
12 |
13 | ## Pull Requests
14 |
15 | Pull requests are, a great way to get your ideas into this repository.
16 |
17 | When deciding if I merge in a pull request I look at the following things:
18 |
19 | ### Does it state intent
20 |
21 | You should be clear which problem you're trying to solve with your contribution.
22 |
23 | For example:
24 |
25 | > Add link to code of conduct in README.md
26 |
27 | Doesn't tell me anything about why you're doing that
28 |
29 | > Add link to code of conduct in README.md because users don't always look in the CONTRIBUTING.md
30 |
31 | Tells me the problem that you have found, and the pull request shows me the action you have taken to solve it.
32 |
33 |
34 | ### Is it of good quality
35 |
36 | * There are no spelling mistakes
37 | * It reads well
38 | * For english language contributions: Has a good score on [Grammarly](grammarly.com) or [Hemingway App](http://www.hemingwayapp.com/)
39 |
40 | ### Does it move this repository closer to my vision for the repository
41 |
42 | The aim of this repository is:
43 |
44 | * To provide a README.md and assorted documents anyone can copy and paste, into their project
45 | * The content is usable by someone who hasn't written something like this before
46 | * Foster a culture of respect and gratitude in the open source community.
47 |
48 | ### Does it follow the contributor covenant
49 |
50 | This repository has a [code of conduct](CODE_OF_CONDUCT.md), This repository has a code of conduct, I will remove things that do not respect it.
51 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Gábor Soós
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vue 3 Playground
2 |
3 | Vue 3 Playground stands as a learning project for those who want to get familiar with [the new features of Vue 3](https://composition-api.vuejs.org/).
4 | [The official documentation](https://v3.vuejs.org/) is now available!
5 |
6 | The project aims to include all the new features. If you find something missing please create an issue/PR.
7 |
8 | The application is a shopping cart where you can alter the name, price and quantity of the products and
9 | recalculates the total price based on the items and used coupon.
10 |
11 | The playground is available also [in online version](https://codesandbox.io/s/github/vuesomedev/vue-3-playground).
12 |
13 | If you want to switch to the Typescript folder uncomment the link to the Typescript main file in `index.html`
14 | and comment out the Javascript main file.
15 |
16 | 
17 |
18 | ### New APIs covered
19 |
20 | The Typescript equivalents can be found in the `src-typescript` folder (file names are the same).
21 |
22 | - [createApp](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/main.js) - [API docs](https://v3.vuejs.org/api/application-api.html)
23 | - [mount](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/main.js) - [API docs](https://v3.vuejs.org/api/application-api.html#mount)
24 | - [use](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/main.js) - [API docs](https://v3.vuejs.org/api/application-api.html#use)
25 | - [ref](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/hooks.js) - [API docs](https://v3.vuejs.org/api/refs-api.html#ref)
26 | - [reactive](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/hooks.js) - [API docs](https://v3.vuejs.org/api/basic-reactivity.html#reactive)
27 | - [computed](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/hooks.js) - [API docs](https://v3.vuejs.org/api/computed-watch-api.html#computed)
28 | - [toRefs](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [Composition API docs](https://composition-api.vuejs.org/#code-organization)
29 | - [watchEffect](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [API docs](https://v3.vuejs.org/api/computed-watch-api.html#watcheffect)
30 | - [watch](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [API docs](https://v3.vuejs.org/api/computed-watch-api.html#watch)
31 | - [onMount](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [API docs](https://v3.vuejs.org/api/composition-api.html#lifecycle-hooks)
32 | - [onUnmount](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [API docs](https://v3.vuejs.org/api/composition-api.html#lifecycle-hooks)
33 | - [onUpdate](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [API docs](https://v3.vuejs.org/api/composition-api.html#lifecycle-hooks)
34 | - [onErrorCaptured](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [API docs](https://v3.vuejs.org/api/composition-api.html#lifecycle-hooks)
35 | - [useStore](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/App.vue) - [Vuex 4 docs](https://github.com/vuejs/vuex/tree/4.0)
36 | - [useRoute](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Checkout.vue) - [Vue 3 router docs](https://github.com/vuejs/vue-router-next)
37 | - [emit](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Coupon.vue)
38 | - [provide](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/version.js) - [API docs](https://v3.vuejs.org/api/composition-api.html#provide-inject)
39 | - [inject](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/version.js) - [API docs](https://v3.vuejs.org/api/composition-api.html#provide-inject)
40 | - [createStore](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/store.js) - [Vuex 4 docs](https://github.com/vuejs/vuex/tree/4.0)
41 | - [createRouter](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/router.js) - [Vue 3 router docs](https://github.com/vuejs/vue-router-next)
42 | - [defineComponent](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Payment.jsx) - [API docs](https://v3.vuejs.org/api/global-api.html#definecomponent)
43 | - [defineAsyncComponent](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/AsyncPayment.js) - [API docs](https://v3.vuejs.org/api/global-api.html#defineasynccomponent)
44 | - [h](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Spinner.js) - [API docs](https://v3.vuejs.org/guide/render-function.html)
45 | - [JSX](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Payment.jsx)
46 | - [Suspense](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue)
47 | - [Async Component](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Exchange.vue)
48 | - [Teleport](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Header.vue) - [API docs](https://v3.vuejs.org/guide/teleport.html#using-with-vue-components)
49 | - [Fragments](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/App.vue)
50 | - [Multiple v-models](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [RFC docs](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0011-v-model-api-change.md)
51 | - [Scoped slot](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/components/Cart.vue) - [RFC docs](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0001-new-slot-syntax.md)
52 | - [Custom directive](https://github.com/vuesomedev/vue-3-playground/blob/master/src/javascript/at-sign.js)
53 |
54 | ### Further articles/videos
55 |
56 | - [Official documentation](https://v3.vuejs.org/)
57 | - [Composition API docs](https://composition-api.vuejs.org/)
58 | - [RFCs describing new features](https://github.com/vuejs/rfcs)
59 | - [Reactivity: Vue 2 vs Vue 3](https://www.vuemastery.com/blog/Reactivity-Vue2-vs-Vue3/)
60 | - [Global Vue Meetup featuring Evan You](https://www.youtube.com/watch?v=Nk3cC7xNfkk)
61 | - [State of Vuenion](https://www.vuemastery.com/conferences/vueconf-us-2020/state-of-the-vuenion/)
62 | - [The process: Making Vue 3](https://increment.com/frontend/making-vue-3/)
63 | - [Vue 3 Async Components and Bundle Splitting](https://lmiller1990.github.io/electic/posts/20200503_vue_3_async_components_and_bundle_splitting.html)
64 | - [Reactivity in Vue 2, 3, and the Composition API](https://vuejsdevelopers.com/2017/03/05/vue-js-reactivity/)
65 | - [React Hooks vs. Vue 3 Composition API](https://academy.esveo.com/en/blog/Yr)
66 | - [Vue 3 Composition API TodoMVC implementation with Vuex and testing](https://github.com/vuesomedev/todomvc-vue-composition-api)
67 |
68 | ### Contributing
69 |
70 | If you have any idea how to include more and more new features of Vue 3 in this application feel free to share your ideas in an issue/PR.
71 |
72 |
--------------------------------------------------------------------------------
/cypress-javascript.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseUrl": "http://localhost:3000",
3 | "integrationFolder": "e2e/javascript",
4 | "pluginsFile": false,
5 | "supportFile": false,
6 | "video": false
7 | }
8 |
--------------------------------------------------------------------------------
/cypress-typescript.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseUrl": "http://localhost:3000",
3 | "integrationFolder": "e2e/typescript",
4 | "pluginsFile": false,
5 | "supportFile": false,
6 | "video": false
7 | }
8 |
--------------------------------------------------------------------------------
/e2e/javascript/index.test.js:
--------------------------------------------------------------------------------
1 | describe('Vue 3 Playground', () => {
2 | it('should display playground text on page', () => {
3 | cy.visit('/');
4 | cy.contains('h2', 'Vue 3.2.33 Playground');
5 | });
6 | });
7 |
--------------------------------------------------------------------------------
/e2e/typescript/index.test.ts:
--------------------------------------------------------------------------------
1 | describe('Vue 3 Playground', () => {
2 | it('should display playground text on page', () => {
3 | cy.visit('/');
4 | cy.contains('h2', 'Vue 3.2.33 Playground');
5 | });
6 | });
7 |
--------------------------------------------------------------------------------
/images/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sonicoder86/vue-3-playground/819e2b720a2a9860ec15891bb5037cd44b9231f6/images/screenshot.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |