React 18 has changed their mounting API ever so slightly:
// Before
import { render } from 'react-dom';
const container = document.getElementById('app');
render(<App />, container);
We've released Vue Test Utils 2.0.0!
# open new terminal in same pwd | |
preexec () { | |
local WD="$(pwd | sed "s/^\/home\/$USER/~/")" | |
export LASTDATE="`date +%T`" | |
if [[ "$TERM" == "rxvt-unicode" || "$TERM" == "rxvt-unicode-256color" ]]; then | |
export COMMAND="$(echo $1 | tr -d '\n')" | |
echo -ne "\e]0;$LOCALNAME $HOST:$WD$ $COMMAND ($LASTDATE)\a" | |
fi | |
} |
Hi! I have tons of experience here (working for EU/US companies from remotely, in my case Australia).
Regarding relocation, the US is basically impossible. I come from a fairly favourable country and even as an experienced developer with a willing sponsor it's still nearly impossible to get a working visa, there's a limited amount and no reliable way to get one, even for huge companies with tons of money.
My brother went through this a while ago (skilled employment visa to the US) and it cost tens of thousands of dollars and literally years. I've gotten a visa for another country and it was a similarly convoluted process, you generally can't apply for them until you have a sponsor lined up, which means you need the job first.
I am not sure about the EU, I'm guessing there is some countries who have more lax visa requirements, but I've heard it's equally hard. That said, unless you are exceptional (aka, better than local talent), it's incredibly hard to convince any employer to jump through all the hoo
// not composable | |
// just a function or 'business logic' | |
function add (n1, n2) { | |
return n1 + n2 | |
} | |
// composable | |
// "bridges" logic and Vue via reactivity | |
useAdd (_n1 = 0, _n2 = 0) { | |
const n1 = ref(n1) |
yarn create vite my-comp --template vue-ts
cd my-comp
yarn install
# add main.js and vite.config.ts below
yarn build vite
/** article: https://lachlan-miller.me/articles/patterns-for-testing-props */ | |
props: { | |
variant: { | |
type: String, | |
required: true, | |
validator: (variant) => { | |
if (!['success', 'warning', 'error'].includes(variant)) { | |
throw Error( | |
`variant is required and must` + |
import { reactive } from 'vue'; | |
type Method = (...args: any[]) => any | |
type StoreWithState<S extends StateTree> = { | |
state: S | |
} | |
type StoreWithActions<A> = { | |
[k in keyof A]: A[k] extends (...args: infer P) => infer R |
// test utils v1 | |
import { mount as testUtilsMount, createLocalVue } from '@vue/test-utils' | |
import Vuex from 'vuex' | |
// some function to create a new Vuex store with your state/mutations etc | |
// you want a fresh one for each test | |
import { createMyVuexStore } from './vuex-store' | |
export function mount(comp, options = {}, store) { | |
const localVue = createLocalVue() |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> | |
</head> | |
<body class="m-4"> | |
<button class="bg-gray-300 my-2 px-4 py-2 rounded-md" onclick="flip()">Flip</button> |