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

refactor(vue-tutorial): move Meteor tutorial to vue3 #23

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
40adf2a
refactor(vue-tutorial): move step01 to vue 3
vit0rr Jul 14, 2023
723fe46
refactor(step01): move to composition
vit0rr Jul 14, 2023
b18b031
docs(step01): update screenshots, code and links
vit0rr Jul 14, 2023
e8564e9
docs(step01): install prettier and eslint
vit0rr Jul 14, 2023
0c62bc1
refactor(step03): move the code to vue3
vit0rr Jul 17, 2023
5be92b3
refactor(step02): replace wrong step03 to 02
vit0rr Jul 18, 2023
4992ca1
refactor(step01): improve screenshots
vit0rr Jul 18, 2023
4e73a63
docs(step02): update the step02
vit0rr Jul 21, 2023
0e14e07
docs(step02): remove unused comment
vit0rr Jul 21, 2023
85f0922
feat(step03): update tutorial and doc
vit0rr Jul 21, 2023
68f8ae6
feat(step04): update the code
vit0rr Jul 21, 2023
e462a44
docs(step04): update the doc
vit0rr Jul 21, 2023
5ddc0b0
feat(step05): update doc and the code
vit0rr Jul 22, 2023
f0ccae2
feat(step06): update the code
vit0rr Jul 22, 2023
4319f0f
docs(step06): update the doc
vit0rr Jul 22, 2023
b5ad6d6
feat(step07): update doc and the code
vit0rr Jul 23, 2023
e71768f
feat(step08): initial state
vit0rr Jul 23, 2023
25a7431
feat(step08): update the code
vit0rr Jul 23, 2023
dc23943
docs(step08): update the doc
vit0rr Jul 23, 2023
367a077
feat(step09): step09 base
vit0rr Jul 27, 2023
28111f2
feat(step09): docs and publications
vit0rr Jul 28, 2023
1e40afd
feat(step10): docs and code
vit0rr Jul 28, 2023
dda46ba
feat(steps): update wrong UI code
vit0rr Jul 28, 2023
71c2d0a
feat(step11): base
vit0rr Jul 28, 2023
d83490b
feat(step11): tests
vit0rr Jul 28, 2023
ab40105
docs(tutorial): remove wrong prettier package and improve autopublish…
vit0rr Aug 2, 2023
59df0be
docs(tutorial): update prettier and step12
vit0rr Aug 2, 2023
7f462f8
doc(step01-02): remove prototype param
vit0rr Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion assets/theme-colors.less
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
// Haven't made any changes as we want the default Meteor colors
.step-images {
border-radius: 6px;
width: 700px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
margin-bottom: 10px;
}
16,819 changes: 9,620 additions & 7,199 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/simple-todos/step01/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'],
plugins: ['prettier'],
rules: {
'prettier/prettier': ['error'],
'vue/require-default-prop': 0,
'vue/html-indent': ['error', 2],
'vue/singleline-html-element-content-newline': 0,
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
},
globals: {
_: true,
},
};
15 changes: 15 additions & 0 deletions src/simple-todos/step01/.meteor/.finished-upgraders
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ notices-for-facebook-graph-api-2
1.5-add-dynamic-import-package
1.7-split-underscore-from-meteor-base
1.8.3-split-jquery-from-blaze
notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1.4.3-split-account-service-packages
1.5-add-dynamic-import-package
1.7-split-underscore-from-meteor-base
1.8.3-split-jquery-from-blaze
2 changes: 1 addition & 1 deletion src/simple-todos/step01/.meteor/.id
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics

gu733n85xrzb.z56vudnb2r4
ndsl3ducl0p.poz2g1vkys0r
23 changes: 10 additions & 13 deletions src/simple-todos/step01/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.4.0 # Packages every Meteor app needs to have
meteor-base@1.5.1 # Packages every Meteor app needs to have
[email protected] # Packages for a great mobile UX
mongo@1.10.1 # The database Meteor supports right now
[email protected].11 # Reactive variable for tracker
mongo@1.16.6 # The database Meteor supports right now
[email protected].12 # Reactive variable for tracker

standard-minifier-css@1.7.2 # CSS minifier run for production mode
standard-minifier-js@2.6.0 # JS minifier run for production mode
standard-minifier-css@1.9.2 # CSS minifier run for production mode
standard-minifier-js@2.8.1 # JS minifier run for production mode
[email protected] # ECMAScript 5 compatibility for older browsers
ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code
typescript@4.1.2 # Enable TypeScript syntax in .ts and .tsx modules
ecmascript@0.16.7 # Enable ECMAScript2015+ syntax in app code
typescript@4.9.4 # Enable TypeScript syntax in .ts and .tsx modules
[email protected] # Server-side component of the `meteor shell` command
[email protected] # Update client in development without reloading the page

[email protected] # Dependency tracker to allow reactive callbacks
static-html # Define static page content in .html files
akryum:vue-component # Vue-CLI template to publish components

meteortesting:mocha # A package for writing and running your meteor app and package tests with mocha
johanbrook:publication-collector # Test a Meteor publication by collecting its output
[email protected] # Define static page content in .html files
vite:bundler
2 changes: 1 addition & 1 deletion src/simple-todos/step01/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@2.1
METEOR@2.12
120 changes: 56 additions & 64 deletions src/simple-todos/step01/.meteor/versions
Original file line number Diff line number Diff line change
@@ -1,79 +1,71 @@
akryum:[email protected]
akryum:[email protected]
akryum:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
blaze-tools@1.0.10
blaze-tools@1.1.3
[email protected]
[email protected]
caching-html-compiler@1.1.3
callback-hook@1.3.0
[email protected].1
[email protected].0
ddp-client@2.4.0
caching-html-compiler@1.2.1
callback-hook@1.5.1
[email protected].2
[email protected].1
ddp-client@2.6.1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].10
[email protected].3
[email protected].11
[email protected]
[email protected]
htmljs@1.0.11
http@1.0.10
[email protected].0
[email protected]
html-tools@1.1.3
htmljs@1.1.1
[email protected].1
[email protected]
johanbrook:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].7
npm-mongo@3.8.1
[email protected].8
npm-mongo@4.16.0
[email protected]
promise@0.11.2
[email protected].0
react-fast-refresh@0.1.0
[email protected].11
promise@0.12.2
[email protected].1
react-fast-refresh@0.2.7
[email protected].12
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
socket-stream-client@0.3.1
spacebars-compiler@1.1.3
standard-minifier-css@1.7.2
standard-minifier-js@2.6.0
static-html@1.2.2
templating-tools@1.1.2
tracker@1.2.0
typescript@4.1.2
[email protected].10
[email protected]
webapp@1.10.0
[email protected].0
socket-stream-client@0.5.1
spacebars-compiler@1.3.1
standard-minifier-css@1.9.2
standard-minifier-js@2.8.1
static-html@1.3.2
templating-tools@1.2.2
tracker@1.3.2
typescript@4.9.4
[email protected].13
vite:[email protected]
webapp@1.13.5
[email protected].1
6 changes: 6 additions & 0 deletions src/simple-todos/step01/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 80
}
19 changes: 19 additions & 0 deletions src/simple-todos/step01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Meteor + Vue3 + Vite

This is a simple example of how to use Vue3 with Meteor.

## How to use

1. Clone this repo
2. Run `meteor npm install`
3. Run `meteor`
4. Open `http://localhost:3000` in your browser

## Libraries used

- [Vue3](https://v3.vuejs.org/)
- [Vite](https://vitejs.dev/)
- [Vue Router](https://next.router.vuejs.org/)
- [Meteor](https://www.meteor.com/)
- [Vue Meteor Tracker](https://github.com/meteor-vue/vue-meteor-tracker)
- [Tailwind CSS](https://tailwindcss.com/)
3 changes: 3 additions & 0 deletions src/simple-todos/step01/client/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
11 changes: 6 additions & 5 deletions src/simple-todos/step01/client/main.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<head>
<title>simple-todos-vue</title>
<meta charset="utf-8"/>
<meta http-equiv="x-ua-compatible" content="ie=edge"/>
<title>step01</title>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta
name="viewport"
content="width=device-width, height=device-height, viewport-fit=cover, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<meta name="mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="app"></div>
</body>
13 changes: 1 addition & 12 deletions src/simple-todos/step01/client/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
import Vue from 'vue'

import '../imports/ui/plugins'

import App from '../imports/ui/App.vue'

Meteor.startup(() => {
new Vue({
el: '#app',
...App,
})
})
// main entry point is in imports/ui/main.jsx
10 changes: 10 additions & 0 deletions src/simple-todos/step01/imports/api/links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';

export const LinksCollection = new Mongo.Collection('links');

if (Meteor.isServer) {
Meteor.publish('links', function () {
return LinksCollection.find({});
});
}
47 changes: 15 additions & 32 deletions src/simple-todos/step01/imports/ui/App.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
<script setup>
import Task from './components/Task.vue';

const getTasks = () => {
return [
{ _id: 1, text: 'This is task 1' },
{ _id: 2, text: 'This is task 2' },
{ _id: 3, text: 'This is task 3' },
];
};
</script>

<template>
<div class="container">
<header>
<h1>Todo List</h1>
<h1 class="text-4xl font-bold text-gray-800 my-4">Todo List</h1>
</header>
<ul>
<Task
v-for="task in getTasks()"
v-bind:key="task._id"
v-bind:task="task"
/>
<ul class="list-disc list-inside p-4">
<Task v-for="task in getTasks()" :key="task._id" :task="task" />
</ul>
</div>
</template>

<script>
import Vue from "vue";
import Task from "./components/Task.vue";

export default {
components: {
Task
},
data() {
return {};
},
methods: {
getTasks() {
return [
{ _id: 1, text: "This is task 1" },
{ _id: 2, text: "This is task 2" },
{ _id: 3, text: "This is task 3" }
];
}
}
};
</script>

<style></style>
17 changes: 7 additions & 10 deletions src/simple-todos/step01/imports/ui/components/Task.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<template>
<li>{{ this.task.text }}</li>
</template>
<script setup>
import { defineProps } from 'vue';

<script>
export default {
props: ["task"],
data() {
return {};
}
};
defineProps(['task']);
</script>

<template>
<li>{{ task.text }}</li>
</template>
13 changes: 13 additions & 0 deletions src/simple-todos/step01/imports/ui/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Meteor } from 'meteor/meteor';
import { createApp } from 'vue';
import { VueMeteor } from 'vue-meteor-tracker';

import App from './App.vue';
import { router } from './router';

Meteor.startup(() => {
const app = createApp(App);
app.use(router);
app.use(VueMeteor);
app.mount('#app');
});
4 changes: 0 additions & 4 deletions src/simple-todos/step01/imports/ui/plugins.js

This file was deleted.

Loading