2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-05-31 04:54:05 +03:00
Commit Graph

183 Commits

Author SHA1 Message Date
pimlie c040de7be7 fix: use timers instead of requestAnimationFrame
The issue with using requestAnimationFrame is that its meant to be used for visual effects. Therefore when a tab is hidden the browser might decide to not perform animation frame updates until the tab becomes visible, this is confirmed behaviour for Firefox. Due to this title updates would not be triggered while document titles are normally visible in the tabs title. For now we batch updates by setting/clearing timeouts with a 10ms interval

Resolves: #313
2019-04-23 10:58:34 +02:00
pimlie e80643b1a8 fix: move addNavGuards check to mounted hook
The addNavGuards check adds the navigation guards when an afterNavigation callback is defined but refreshOnceOnNavigation was not set. As the afterNavigation callback is defined in metaInfo which can be dependent on user data we need to wait until all components are fully mounted before checking if a afterNavigation callback was defined

Fixes: #348
2019-04-23 09:30:38 +02:00
pimlie c7913511fc chore: remove old files after merge 2019-04-20 12:53:57 +02:00
pimlie 8ad6adedc9 Merge branch 'next' 2019-04-20 12:49:06 +02:00
Pim 3c6db84185 refactor: dont use Array.includes (#339)
its not supported in IE and not polyfilled in vue-meta v1
2019-03-28 14:50:39 +01:00
Xin Du (Clark) 2141bab00c feat: don't generate title tag if title is empty (#334)
* fix: not generate title tag if title is empty

* fix: align title to document.title api

* refactor: trim data
2019-03-28 13:30:29 +01:00
pimlie 717c30303f test: add e2e tests 2019-03-23 16:00:30 +01:00
pimlie d38f81e0a9 fix: implement simply array polyfills (fixes #328) 2019-03-12 10:03:46 +01:00
pimlie 7cf4efd290 test: add nav-guard tests for refresOnce false 2019-03-12 10:03:46 +01:00
pimlie d717dbf4e1 fix: dont use object.assign/spread
so we dont need a polyfill
2019-03-12 10:03:46 +01:00
pimlie 93f021b757 fix: only add navguards when refreshOnceOnNav is false 2019-03-12 10:03:46 +01:00
pimlie 93fb900a85 refactor: let transpiler fix Array.isArray 2019-03-12 10:03:46 +01:00
pimlie 6405724881 refactor: move utils to utils folder 2019-03-12 10:03:46 +01:00
pimlie 4c967b0b4b refactor: missed template import 2019-03-12 10:03:46 +01:00
pimlie 4a8f9753e0 fix: afterNavigation logic (its never set in options) 2019-03-12 10:03:46 +01:00
pimlie 419951c59f refactor: combine meta helpers 2019-03-12 10:03:46 +01:00
pimlie f92fb67619 refactor: rename to template module 2019-03-12 10:03:46 +01:00
pimlie 2adba84e58 refactor: combine escape info 2019-03-12 10:03:46 +01:00
pimlie 2b24acc8b2 refactor: set defaultOptions in shared/constants 2019-03-12 10:03:46 +01:00
pimlie c1f97c4ea4 refactor: move isArray into is-type 2019-03-12 10:03:46 +01:00
pimlie 05b8891110 test: add e2e tests
fix: boolean attributes client side
2019-03-12 10:03:46 +01:00
pimlie a853ce3de7 Revert "refactor: remove beforeMount hook"
This reverts commit 3a6374e2afa57e624c60e42277f71edc998f1f9f.
2019-03-12 10:03:46 +01:00
pimlie 18fd23d3c0 refactor: remove beforeMount hook
This shouldnt be necessary anymore because we force initialization once on mounted/nextTick. Using beforeMount is also inherently less optimal because you are unlikely to benefit from walking the component tree as beforeMount is called before all child components are loaded. So using beforeMount resulted probably that for every component which uses metaInfo a refresh was called on load.

A possible caveat that may exists due to removing beforeMount in favor of a single refresh is that it takes longer for your metaInfo to be updated if you have a lot of components on your page, not sure if this will be a problem in real world scenarios because if this is a problem you should probably be using ssr anyway. Also the v1 docs state that using beforeMount also results in a single update (although in practice it could be more then one)
2019-03-12 10:03:46 +01:00
pimlie f490a48b99 refactor: small improvements (mainly tests) 2019-03-12 10:03:46 +01:00
pimlie 5ad671169b fix: dont call changed with explicit this
in refresh this is probably not the component changed was defined on, removing call(this) gives context control back to the user
2019-03-12 10:03:46 +01:00
pimlie 5f8025e126 test: increase coverage, add missing tests
fix: issues discovered by adding missing tests
2019-03-12 10:03:46 +01:00
pimlie ce7eaf56d3 test: add missing test for sanitizeByTagId
fix: broken sanitizeByTagId implementation
2019-03-12 10:03:46 +01:00
pimlie da4bb27a4b refactor: just pass all options to getComponentOption 2019-03-12 10:03:46 +01:00
pimlie 9d8ea758ac refactor: prefer ternary 2019-03-12 10:03:46 +01:00
Alexander Lichter 6f1b080654 refactor: prefer destruct syntax
Co-Authored-By: pimlie <pimlie@hotmail.com>
2019-03-12 10:03:46 +01:00
pimlie 01edc8c242 feat: attr keys can have array values (resolves #231) 2019-03-12 10:03:46 +01:00
pimlie 6e18a7d54a chore: fix lint 2019-03-12 10:03:46 +01:00
pimlie 104113a7b8 fix: use undefined as child ignore indicator 2019-03-12 10:03:46 +01:00
pimlie 915fedfb7f feat: child can indicate parent vmid to be removed (resolves: #288) 2019-03-12 10:03:46 +01:00
pimlie 22e456cbe2 feat: child can indicate its content should be ignored (resolves: #204) 2019-03-12 10:03:46 +01:00
pimlie 4dafffea4e refactor: prefer forEach 2019-03-12 10:03:46 +01:00
pimlie b7ee0409ea feat: add amp as boolean attribute (resolves: #311) 2019-03-12 10:03:46 +01:00
pimlie 7615f4120c fix: ignore data when its not an object (fixes: #253, #279, #297) 2019-03-12 10:03:46 +01:00
pimlie 23c3380c90 refactor: optimize getComponentOption by making it less generic 2019-03-12 10:03:46 +01:00
pimlie 7b888c9437 refactor: optimize getMetaInfo by extracting functions
this should make it easier for javascript engines to optimize these functions
2019-03-12 10:03:46 +01:00
pimlie 12c7949132 fix: dont updateTags when the new info is not an array 2019-03-12 10:03:46 +01:00
pimlie cd98210acb refactor: make hasMetaInfo default export 2019-03-12 10:03:46 +01:00
pimlie f2e8eb537d feat: track branches which contain metaInfo components 2019-03-12 10:03:46 +01:00
pimlie fa90902fc7 refactor: extract applyTemplate method and make it more generic 2019-03-12 10:03:46 +01:00
pimlie 15eb9ccfd1 refactor: extract merge methods 2019-03-12 10:03:46 +01:00
pimlie 95ba9c0291 refactor: extract escape method 2019-03-12 10:03:46 +01:00
pimlie 31e975d312 feat: add getOptions method (resolves: #215) 2019-03-12 10:03:46 +01:00
pimlie 97badf61cb feat: add afterNavigation callback (fix: #259) 2019-03-05 15:11:25 +01:00
pimlie 173b31d1d7 feat: export hasMetaInfo helper function 2019-03-05 14:17:28 +01:00
pimlie f597f61104 Revert "feat: use named exports to export helper functions"
This reverts commit 95c3b7d4e8.
2019-03-05 14:12:56 +01:00