- Talks
- ⭐️State of Vuenion 2020
- Scalable Vue Graphics
- Vue Test Utils
- ⭐️Vue 3 Composition API
- ⭐️Composition API - Emerging Best Practices
- Making eCommerce with VueStorefront and Composition API
- Serverless Static Sites with Vue and Node.js
- Climate Change and the Tech Community
- ⭐️Application Shortcuts with Renderless Event Components
- Content Loading that isn’t broken
- Team First
- ⭐️What is Nuxt 2020?
- Deep Dive into Nuxt.js
- ⭐️Animated Guide to Vue 3
- Validations in Composition Age
- Authentication from Scratch
- ⭐️Test-Driven Development with Vue
- Vuetify 2+
- New Vue. New Compiler. Let’s unbox.
- You might not need Vuex
- ⭐️Vuex ORM
- BootstrapVue - Road to 2.0 and beyond
- Micro Fontends: composing a greater whole
- ⭐️What you’ll love in Vue 3
- Performant components through customization
- ⭐️What’s new in Vue CLI UI
- Vue-Router and its techniques
- Building Blazing Fast Sites with Gridsome
- Full Static with Nuxt
- Other Noteworthy Things
New Composition API is technically completely optional but highly recommended.
Composition API's setup
function can be async.
Full TypeScript support, but can still be ignored and just used with plain JavaScript.
Full source map support to trace back errors in code.
VDOM has been incredibly optimized for performance. Check out the template explorer in the links section and play around.
3x faster SSR
Roadmap:
- Currently Alpha
- Beta in Q1
- Release planned for Q1, likely Q2
- More or less feature complete already but a lot of work has to be done regarding documentation and migration guides and tooling
- Vue 3: https://github.com/vuejs/vue-next
- Vue 3 Template Explorer: https://vue-next-template-explorer.netlify.com
- Vue 2 Template Explorer: https://template-explorer.vuejs.org
- VueMastery Vue Cheat Sheet: https://www.vuemastery.com/vue-cheat-sheet/
Try using more svgs
Benefits:
- Scalable
- Media Queriable
- Usable as Vue-Component with v-if, reactiveness, etc.
- Lottie for SVG-Animations: https://airbnb.io/lottie/
- GSAP for SVG-Animations: https://greensock.com/gsap/
Vue Test Utils Definition: Library of functions to ensure nice and fresh states for each test.
Use wrapper.vm to access actual vnode.
- Vue Test Utils: https://github.com/vuejs/vue-test-utils
- Vue Testing Library: https://github.com/testing-library/vue-testing-library
Organize code by logical concern.
- Vue Composition API Plugin for Vue 2: https://github.com/vuejs/composition-api
- VueMastery: https://vuemastery.com/
- VueMastery Composition API Cheat Sheet: https://www.vuemastery.com/pdf/Vue-3-Cheat-Sheet.pdf
Use ref(...)
for reactive variables and access their value with .value
.
Use reactive(...)
for reactive objects. Cannot be spread or it will lose it's reactivity.
ref
vs. reactive
: If in doubt, use ref. Mainly for consistancy with .value
. Generally just personal preference though.
Extracts code by logic into useFeature()
functions.
Also great for creating plugins.
Use Composition API with computed for readonly values.
- Presentation: https://github.com/LinusBorg/talks/tree/master/2020-02-20%20Vuejs%20Amsterdam
- Twitter Thread Summary: https://twitter.com/sarah_edo/status/1230453658233507840
- Villus GraphQL Client: https://logaretm.github.io/villus/
- VueStorefront: https://www.vuestorefront.io/
- Smashing Magazine: https://www.smashingmagazine.com/
- Fauna: https://fauna.com/
Make website more efficient and performant. Especially backend, since that's where the heavy stuff is done.
Use WebsiteCarbon to test websites. Use Google Lighthouse to check for unnecessary sources etc. Lazy load images
- Website Carbon Calculator: https://www.websitecarbon.com/
- Climate Action: https://climateaction.tech/
Component to easily add global (not dom element specific) event handlers. (eg. keyboard shortcuts) Keyboard shortcut everything.
- Presentation Demo: https://github.com/vueschool/application-shortcuts
- Vue Global Events: https://github.com/shentao/vue-global-events
Use aria-live regions to announce non-interactive content changes. (eg. for screen readers)
- aria-live
- aria-current
- tabindex (try not to use positive numbers, use dom oder instead)
- aria-label
- Presentation Demo: https://github.com/mlama007/Vue-Memory-Game
- Vue School Course: https://vueschool.io/courses/web-accessibility-fundamentals
- NerdeFocus Chrome Extension: https://chrome.google.com/webstore/detail/nerdefocus/lpfiljldhgjecfepfljnbjnbjfhennpd
Assumption is the Mother of all Fuck-ups
So don't assume - Research, debug, ask and know
As a leader:
- Trust your team
- Growth - let people champion subjects
As a dev:
- Failure is iteration - feel free to restart something
- Helicopter view - step back and look at what’s in front of you
- Tim Benniks YouTube: https://www.youtube.com/user/timbenniks
New fetch
function (similar to asyncData but called after page/component is mounted)
- $fetchState to track state of
fetch
function - can be used inside of components, not only in pages
mode: "universal" | "spa"
becomes ssr: true | false
and nuxt build --spa
becomes nuxt build --no-ssr
Static generation new with target: "static"
nuxt generate
becomes two commands: nuxt build
and nuxt export
New Nuxt Crawler for dynamic routes so all the slug pages don't have to be listed. Crawler crawls all nuxt-links to find pages to render.
- Nuxt Next (Vue 3): https://github.com/nuxt/nuxt.js/tree/next
- VueMastery Nuxt Cheat Sheet: https://www.vuemastery.com/nuxt-cheat-sheet/
Nuxt Functions, more advances serverMiddleware to extend server with simple logic.
functions/
directory, similar to pages (automatically mapped to a route based on filename)- Can be used for simple serverside tasks such as stripe transation processing, image resizing, pdf generation, etc.
Not fully understood how they will work. Mentioned benefit: Function will be called via http from clientside and as a function on serverside. AWS Lambda was mentioned in this context. Will those functions be truly separated and serverless out of the box with AWS Lambda?!
Sarah Drasner presented Vue 3 principles with amazing animations that will be added to the doc at some point.
Things necessary for something to be reactive:
- Detect changes in a value
- Track function that changes the value
- Trigger the function again so it can update the final value
- Have a getter get the original value to keep a single source of truth
- Trap: Returning a value the user isn't expecting. (eg. statically return something)
- Proxies are ES6 (previously
Object.defineProperty
)
- Array of unique items
- Unique key value pairs
- Keep original order of items
- Deliver rendered HTML to client
- Build VDOM from DOM to make existing, rendered elements dynamic.
Nuxt static and deploy to a CDN to have it globally spread.
- Increases performance and security
- Does not have to be only static, can call APIs as well
- Presentation: https://github.com/sdras/animated-guide-vue3
- Vue 3 Reactivity Package: https://github.com/vuejs/vue-next/tree/master/packages/reactivity
- VuePress: https://vuepress.vuejs.org/
VeeValidate is template base Vuelidate is model based (validations in validation function in script)
Several problems with Vuelidate until now Vuelidate v2.0:
- Complete rewrite
- Based on Vue 3
- Lazy validation
- Built in support for error messages
Schema based forms (construct forms with js objects) "Bring your own Components" approach
- Presentation Demo: https://github.com/shentao/fvlidate
- Vuelidate: https://vuelidate.js.org/
- Vuelidate Next (Vue 3): https://github.com/vuelidate/vuelidate/tree/next
- FormVueLatte: https://github.com/vuelidate/formvuelatte
- Vue.js News: https://news.vuejs.org/
Usually libraries are used. In this case built from scratch using JWT (JSON Web Token) and Vue. Vue Side only
Flow:
- Vuex action makes register/login HTTP-Request
- Response is passed to mutation
- Mutation stores userdata to state and localStorage and sets the axios
Authorization
header.
- VueMastery Course: https://www.vuemastery.com/courses/token-based-authentication/intro-to-authentication
- VueMastery Conference Library: https://www.vuemastery.com/conferences
Testing is one big pillar for robust software. Software is harder to refactor without tests.
TDD (Test-Driven Development) was popularized by Kent Beck.
Stages:
- Red: Write specification for test and make sure it fails.
- Green: Make test pass with the simplest, most stupid code possible. (even if it's just hardcoding something)
- Refactor: Work on the actual implementation of the feature. Goal: Keep the test green.
Fixing issues is perfect. You know what you want, but not what you need. Write the specs.
Not sure about what to test? Ask yourself this: Does anyone care about this if it changes? If so, write tests.
- Presentation: https://noti.st/sarahdayan/q0xtRN
- Dinero.js: https://sarahdayan.github.io/dinero.js/
- Algolia: https://www.algolia.com/
- JavaScript Exponential Operator: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators#Exponentiation_assignment
- Vue CLI Plugins: https://github.com/vuetifyjs/vue-cli-plugins
- Vue CLI Preset: https://github.com/vuetifyjs/vue-cli-preset-vuetify
- Vuetify Notion: https://notion.vuetifyjs.com/
- Community: https://community.vuetifyjs.com/
Two parts:
- Template Compiler: Handles and converts render functions.
- SFC Compiler (Single File Component)
You could use the data-test
attribute to match elements in tests.
Transform functions are used to get compiled template ready for render functions. Multiple transforms can be used and custom transforms can be integrated.
- Presentation: https://speakerdeck.com/znck/new-vue-new-compiler-lets-unpack
- Compiler Core: https://www.npmjs.com/package/@vue/compiler-core
- Compiler DOM: https://www.npmjs.com/package/@vue/compiler-dom
- Compiler SSR: https://www.npmjs.com/package/@vue/compiler-ssr
Needed when there's a shared state with:
- Deep nested components
- Independent components
- Different routes
You can provide and inject state with reactive from composition api. Don't change data where it's injected.
If you use vue-apollo, use apollo cache for local state.
- Presentation: https://gitlab.com/ntepluhina/vuex-presentation
- Pinia: https://github.com/posva/pinia
Laravel like models and access to vuex state.
Why would you ORM the store?
- Prevent having same data in multiple places
"The recommended approach to managing relational or nested data in a Redux store is to treat a portion of your store as if it were a database" - Redux Documentation
Vuex ORM supports additional plugins. Official plugins are:
- Vuex ORM Axios
- Vuex ORM GraphQL
- Vuex ORM Search (Fuse.js integration)
- Vuex ORM Soft Delete
- Vuex ORM Change Flags (IsDirty / IsNew flags)
- Vuex ORM: https://github.com/vuex-orm/vuex-orm
- Vuex ORM Slack: https://vuex-orm.slack.com/
As a contributer:
- Follow the contribution guidelines
- Stay in contact with the maintainers and show your interest
- Start small, even small contributions count
- Be patient!
Plugin example from vonage business cloud. Microservices in frontend? Frontend challenges:
- Unified user experience
- Small bundle size (backend doesn't really care)
- Backend Microservices are autonomous, frontend isn't.
- No standard library
Frontend microservices would be:
- Independently deployed apps that work together in the browser.
Unified UX:
- Shared CSS libraries for all devs
- Shared components
- Micro-Frontends: https://github.com/vonage/micro-frontends
- Vonage Nexmo: https://www.vonage.com/business/nexmo/
Reactively setting, deleting object props and pushing array items.
Vue.set(this.object, index, value)
becomes this.object[index] = value
and still triggers reactivity.
Portals:
- A portal-target elment needs an id
- New portal component with target attribute
Usecases: Modals, Notifications, Popups, Layout content, etc.
v-model="foo"
becomes v-model:foo="anyValue"
Allows multiple v-models.
Composition API
Suspense is a new component used to have fallback content based on a condition.
Filters are removed, just make a function.
Other changes include:
- Global mounting API change
- Transparent wrappers are simplified
- Slots unification
- Optional props declaration
- Transition as root
Why should you upgrade?
- Performance
- New features
- Typescript support
- portal-vue: https://github.com/LinusBorg/portal-vue
- Exciting new Features: https://vueschool.io/articles/vuejs-tutorials/exciting-new-features-in-vue-3/
A component library needs visual consistancy and functional consistancy. A good component library includes a design system.
Customizability (style guide):
- Colors and themes
- Typography
- Paddings, margins, sizes
- Icons
Template customization using slots instead of props.
- Presentation Demo: https://github.com/mayashavin/storefrontui-demo-store
- StorefrontUI: https://www.storefrontui.io/
- Cloudinary: https://cloudinary.com/
- Atomic Design: https://atomicdesign.bradfrost.com/
Why a GUI?
- Easier to use
- Self-explanatory
- Richer interactions
gui.js is Guillaumes new Project to have GUIs for various framework CLIs:
- An app natively installed instead of starting a webserver.
- GUI for all kinds of CLIs (Nuxt, Vue, Vuetify, etc.)
- Manage packages
- Start scripts
- Supports mono projects
- No electron! Much more performant.
- gui.js: https://guijs.dev/
- gui.js Github: https://github.com/Akryum/guijs
- Awesome.js: https://awesomejs.dev/
Don't use router.push()
with unencoded urls because vue-router will not change the url.
Either use the encoded url or use an object with a route name.
How Browsers handle unencoded hashes:
Vue-Router-Next:
- Dynamic routing (programmatically add/remove routes)
- Custom History
- Better encoding defaults
- Composition API
- Navigation direction
- Better TS support
- Easier to contribute
- More per-case documentation
- Vue-Router Next (Vue 3): https://github.com/vuejs/vue-router-next
- RFC: vuejs/rfcs#122
- Eduardos Website: https://esm.dev/
Gridsome is a Vue framework for building static sites. Write a Vue app and serve it pre-rendered at build time.
Make great user experience by making it easy to do for the devs.
Which framework should you use? (gridsome, nuxt, etc.) Evaluate all trade-offs of all frameworks to find the right one for you. (just use gridsome is what jake said eventually
- Gridsome: https://gridsome.org/
- Jamstack: https://jamstack.org/
- What's the v-for key for (no one knows): https://vuejs.org/v2/api/#key
"Gridsome or Nuxt, doens't matter. Just go static."
Nuxt static isn't just for blogs.
API's can still be consumed.
- Forms
- Headless CMS
- Auth
Advantages:
- Better performance
- Not having a single point of origin server.
- Fully static is much faster. API calls have latency - always takes longer.
- No real server needed anyway, just a CDN. Cheaper and safer.
- Reduces carbon footprint
- You don't have to expose your API to the public.
- You decide when to publish new content from your API by re-generating your website.
- Better offline support
- Payload files are cached and offline support with PWA.
- Nuxt Boilerplate Project: https://github.com/debs-obrien/nuxt-boilerplate-project
- Netlify CMS: https://www.netlifycms.org/
- Hasura: https://hasura.io/
- nuxtjs/apollo: https://github.com/nuxt-community/apollo-module
- Developer Podcast: https://developer.fm/