Skip to content

Commit bffa8f1

Browse files
committed
chore(release): 3.0.0-alpha.5
1 parent 29b294c commit bffa8f1

10 files changed

+30
-121
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [3.0.0-alpha.5](https://github.com/nuxt/vue-meta/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2021-05-03)
6+
7+
8+
### Bug Fixes
9+
10+
* apply diff on nested computed objects ([29b294c](https://github.com/nuxt/vue-meta/commit/29b294c2be1bdbb57d6341871df72848c9d0b034))
11+
* dont include ssr support in main dist ([5699bf4](https://github.com/nuxt/vue-meta/commit/5699bf4ff202a731830621583183dd8ae97a2c7c))
12+
513
## [3.0.0-alpha.4](https://github.com/nuxt/vue-meta/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2021-04-11)
614

715

dist/vue-meta.cjs.js

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-meta v3.0.0-alpha.4
2+
* vue-meta v3.0.0-alpha.5
33
* (c) 2021
44
* - Pim (@pimlie)
55
* - All the amazing contributors
@@ -12,18 +12,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
1212

1313
var vue = require('vue');
1414

15-
function _interopNamespace(e) {
16-
if (e && e.__esModule) return e;
17-
var n = Object.create(null);
18-
if (e) {
19-
Object.keys(e).forEach(function (k) {
20-
n[k] = e[k];
21-
});
22-
}
23-
n['default'] = e;
24-
return Object.freeze(n);
25-
}
26-
2715
const resolveOption = (predicament, initialValue) => (options, contexts) => {
2816
let resolvedIndex = -1;
2917
contexts.reduce((acc, context, index) => {
@@ -330,7 +318,7 @@ const createHandler = (context, resolveContext, pathSegments = []) => ({
330318
},
331319
set: (target, key, value) => {
332320
const success = Reflect.set(target, key, value);
333-
// console.warn(success, 'PROXY SET\nkey:', key, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
321+
// console.warn(success, 'PROXY SET\nkey:', key, '\nvalue:', value, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
334322
if (success) {
335323
const isArrayItem = isArray(target);
336324
let hasArrayParent = false;
@@ -661,9 +649,8 @@ function applyDifference(target, newSource, oldSource) {
661649
target[key] = newSource[key];
662650
continue;
663651
}
664-
// We dont care about nested objects here , these changes
665-
// should already have been tracked by the MergeProxy
666652
if (isObject(target[key])) {
653+
applyDifference(target[key], newSource[key], oldSource[key]);
667654
continue;
668655
}
669656
if (newSource[key] !== oldSource[key]) {
@@ -696,7 +683,6 @@ function useMeta(source, manager) {
696683
}
697684
if (vue.isProxy(source)) {
698685
vue.watch(source, (newSource, oldSource) => {
699-
// We only care about first level props, second+ level will already be changed by the merge proxy
700686
applyDifference(metaProxy.meta, newSource, oldSource);
701687
});
702688
source = source.value;
@@ -863,31 +849,10 @@ MetaManager.create = (config, resolver) => {
863849
return manager;
864850
};
865851

866-
async function renderToStringWithMeta(app) {
867-
const { renderToString } = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@vue/server-renderer')); });
868-
const ctx = {};
869-
const html = await renderToString(app, ctx);
870-
// TODO: better way of determining whether meta was rendered with the component or not
871-
if (!ctx.teleports || !ctx.teleports.head) {
872-
const teleports = app.config.globalProperties.$metaManager.render();
873-
await Promise.all(teleports.map((teleport) => renderToString(teleport, ctx)));
874-
}
875-
const { teleports } = ctx;
876-
for (const target in teleports) {
877-
if (target.endsWith('Attrs')) {
878-
const str = teleports[target];
879-
// match from first space to first >, these should be all rendered attributes
880-
teleports[target] = str.slice(str.indexOf(' ') + 1, str.indexOf('>'));
881-
}
882-
}
883-
return [html, ctx];
884-
}
885-
886852
exports.createMetaManager = createMetaManager;
887853
exports.deepestResolver = defaultResolver;
888854
exports.defaultConfig = defaultConfig;
889855
exports.getCurrentManager = getCurrentManager;
890-
exports.renderToStringWithMeta = renderToStringWithMeta;
891856
exports.resolveOption = resolveOption;
892857
exports.useActiveMeta = useActiveMeta;
893858
exports.useMeta = useMeta;

dist/vue-meta.cjs.prod.js

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-meta v3.0.0-alpha.4
2+
* vue-meta v3.0.0-alpha.5
33
* (c) 2021
44
* - Pim (@pimlie)
55
* - All the amazing contributors
@@ -12,18 +12,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
1212

1313
var vue = require('vue');
1414

15-
function _interopNamespace(e) {
16-
if (e && e.__esModule) return e;
17-
var n = Object.create(null);
18-
if (e) {
19-
Object.keys(e).forEach(function (k) {
20-
n[k] = e[k];
21-
});
22-
}
23-
n['default'] = e;
24-
return Object.freeze(n);
25-
}
26-
2715
const resolveOption = (predicament, initialValue) => (options, contexts) => {
2816
let resolvedIndex = -1;
2917
contexts.reduce((acc, context, index) => {
@@ -327,7 +315,7 @@ const createHandler = (context, resolveContext, pathSegments = []) => ({
327315
},
328316
set: (target, key, value) => {
329317
const success = Reflect.set(target, key, value);
330-
// console.warn(success, 'PROXY SET\nkey:', key, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
318+
// console.warn(success, 'PROXY SET\nkey:', key, '\nvalue:', value, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
331319
if (success) {
332320
const isArrayItem = isArray(target);
333321
let hasArrayParent = false;
@@ -654,9 +642,8 @@ function applyDifference(target, newSource, oldSource) {
654642
target[key] = newSource[key];
655643
continue;
656644
}
657-
// We dont care about nested objects here , these changes
658-
// should already have been tracked by the MergeProxy
659645
if (isObject(target[key])) {
646+
applyDifference(target[key], newSource[key], oldSource[key]);
660647
continue;
661648
}
662649
if (newSource[key] !== oldSource[key]) {
@@ -689,7 +676,6 @@ function useMeta(source, manager) {
689676
}
690677
if (vue.isProxy(source)) {
691678
vue.watch(source, (newSource, oldSource) => {
692-
// We only care about first level props, second+ level will already be changed by the merge proxy
693679
applyDifference(metaProxy.meta, newSource, oldSource);
694680
});
695681
source = source.value;
@@ -856,31 +842,10 @@ MetaManager.create = (config, resolver) => {
856842
return manager;
857843
};
858844

859-
async function renderToStringWithMeta(app) {
860-
const { renderToString } = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@vue/server-renderer')); });
861-
const ctx = {};
862-
const html = await renderToString(app, ctx);
863-
// TODO: better way of determining whether meta was rendered with the component or not
864-
if (!ctx.teleports || !ctx.teleports.head) {
865-
const teleports = app.config.globalProperties.$metaManager.render();
866-
await Promise.all(teleports.map((teleport) => renderToString(teleport, ctx)));
867-
}
868-
const { teleports } = ctx;
869-
for (const target in teleports) {
870-
if (target.endsWith('Attrs')) {
871-
const str = teleports[target];
872-
// match from first space to first >, these should be all rendered attributes
873-
teleports[target] = str.slice(str.indexOf(' ') + 1, str.indexOf('>'));
874-
}
875-
}
876-
return [html, ctx];
877-
}
878-
879845
exports.createMetaManager = createMetaManager;
880846
exports.deepestResolver = defaultResolver;
881847
exports.defaultConfig = defaultConfig;
882848
exports.getCurrentManager = getCurrentManager;
883-
exports.renderToStringWithMeta = renderToStringWithMeta;
884849
exports.resolveOption = resolveOption;
885850
exports.useActiveMeta = useActiveMeta;
886851
exports.useMeta = useMeta;

dist/vue-meta.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { App, ComponentInternalInstance, Slots, VNode } from 'vue';
2-
import { SSRContext } from '@vue/server-renderer';
32

43
declare const IS_PROXY: unique symbol;
54
declare const PROXY_SOURCES: unique symbol;
@@ -204,10 +203,8 @@ interface ResolveOptionPredicament<T, U> {
204203
}
205204
declare const resolveOption: <T, U = ResolveContext>(predicament: ResolveOptionPredicament<T, U>, initialValue?: T | undefined) => ResolveMethod<any, U>;
206205

207-
declare function renderToStringWithMeta(app: App): Promise<[string, SSRContext]>;
208-
209206
declare function getCurrentManager(vm?: ComponentInternalInstance): MetaManager | undefined;
210207
declare function useMeta(source: MetaSource, manager?: MetaManager): MetaProxy;
211208
declare function useActiveMeta(): MetaActive;
212209

213-
export { MetaActive, MetaConfig, MetaConfigSection, MetaConfigSectionAttribute, MetaConfigSectionGroup, MetaConfigSectionKey, MetaConfigSectionTag, MetaGroupConfig, MetaGuardRemoved, MetaGuards, MetaProxy, MetaRenderContext, MetaRendered, MetaRenderedNode, MetaResolveContext, MetaResolveSetup, MetaResolver, MetaResolverSetup, MetaSource, MetaSourceProxy, MetaTagConfig, MetaTagConfigKey, MetaTagName, MetaTagsConfig, MetaTeleports, Modify, SlotScopeProperties, TODO, createMetaManager, deepest_d as deepestResolver, defaultConfig, getCurrentManager, renderToStringWithMeta, resolveOption, useActiveMeta, useMeta };
210+
export { MetaActive, MetaConfig, MetaConfigSection, MetaConfigSectionAttribute, MetaConfigSectionGroup, MetaConfigSectionKey, MetaConfigSectionTag, MetaGroupConfig, MetaGuardRemoved, MetaGuards, MetaProxy, MetaRenderContext, MetaRendered, MetaRenderedNode, MetaResolveContext, MetaResolveSetup, MetaResolver, MetaResolverSetup, MetaSource, MetaSourceProxy, MetaTagConfig, MetaTagConfigKey, MetaTagName, MetaTagsConfig, MetaTeleports, Modify, SlotScopeProperties, TODO, createMetaManager, deepest_d as deepestResolver, defaultConfig, getCurrentManager, resolveOption, useActiveMeta, useMeta };

dist/vue-meta.esm-browser.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-meta v3.0.0-alpha.4
2+
* vue-meta v3.0.0-alpha.5
33
* (c) 2021
44
* - Pim (@pimlie)
55
* - All the amazing contributors
@@ -314,7 +314,7 @@ const createHandler = (context, resolveContext, pathSegments = []) => ({
314314
},
315315
set: (target, key, value) => {
316316
const success = Reflect.set(target, key, value);
317-
// console.warn(success, 'PROXY SET\nkey:', key, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
317+
// console.warn(success, 'PROXY SET\nkey:', key, '\nvalue:', value, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
318318
if (success) {
319319
const isArrayItem = isArray(target);
320320
let hasArrayParent = false;
@@ -666,9 +666,8 @@ function applyDifference(target, newSource, oldSource) {
666666
target[key] = newSource[key];
667667
continue;
668668
}
669-
// We dont care about nested objects here , these changes
670-
// should already have been tracked by the MergeProxy
671669
if (isObject(target[key])) {
670+
applyDifference(target[key], newSource[key], oldSource[key]);
672671
continue;
673672
}
674673
if (newSource[key] !== oldSource[key]) {
@@ -701,7 +700,6 @@ function useMeta(source, manager) {
701700
}
702701
if (isProxy(source)) {
703702
watch(source, (newSource, oldSource) => {
704-
// We only care about first level props, second+ level will already be changed by the merge proxy
705703
applyDifference(metaProxy.meta, newSource, oldSource);
706704
});
707705
source = source.value;

dist/vue-meta.esm-browser.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-meta.esm-bundler.js

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-meta v3.0.0-alpha.4
2+
* vue-meta v3.0.0-alpha.5
33
* (c) 2021
44
* - Pim (@pimlie)
55
* - All the amazing contributors
@@ -314,7 +314,7 @@ const createHandler = (context, resolveContext, pathSegments = []) => ({
314314
},
315315
set: (target, key, value) => {
316316
const success = Reflect.set(target, key, value);
317-
// console.warn(success, 'PROXY SET\nkey:', key, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
317+
// console.warn(success, 'PROXY SET\nkey:', key, '\nvalue:', value, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
318318
if (success) {
319319
const isArrayItem = isArray(target);
320320
let hasArrayParent = false;
@@ -645,9 +645,8 @@ function applyDifference(target, newSource, oldSource) {
645645
target[key] = newSource[key];
646646
continue;
647647
}
648-
// We dont care about nested objects here , these changes
649-
// should already have been tracked by the MergeProxy
650648
if (isObject(target[key])) {
649+
applyDifference(target[key], newSource[key], oldSource[key]);
651650
continue;
652651
}
653652
if (newSource[key] !== oldSource[key]) {
@@ -680,7 +679,6 @@ function useMeta(source, manager) {
680679
}
681680
if (isProxy(source)) {
682681
watch(source, (newSource, oldSource) => {
683-
// We only care about first level props, second+ level will already be changed by the merge proxy
684682
applyDifference(metaProxy.meta, newSource, oldSource);
685683
});
686684
source = source.value;
@@ -847,24 +845,4 @@ MetaManager.create = (config, resolver) => {
847845
return manager;
848846
};
849847

850-
async function renderToStringWithMeta(app) {
851-
const { renderToString } = await import('@vue/server-renderer');
852-
const ctx = {};
853-
const html = await renderToString(app, ctx);
854-
// TODO: better way of determining whether meta was rendered with the component or not
855-
if (!ctx.teleports || !ctx.teleports.head) {
856-
const teleports = app.config.globalProperties.$metaManager.render();
857-
await Promise.all(teleports.map((teleport) => renderToString(teleport, ctx)));
858-
}
859-
const { teleports } = ctx;
860-
for (const target in teleports) {
861-
if (target.endsWith('Attrs')) {
862-
const str = teleports[target];
863-
// match from first space to first >, these should be all rendered attributes
864-
teleports[target] = str.slice(str.indexOf(' ') + 1, str.indexOf('>'));
865-
}
866-
}
867-
return [html, ctx];
868-
}
869-
870-
export { createMetaManager, defaultResolver as deepestResolver, defaultConfig, getCurrentManager, renderToStringWithMeta, resolveOption, useActiveMeta, useMeta };
848+
export { createMetaManager, defaultResolver as deepestResolver, defaultConfig, getCurrentManager, resolveOption, useActiveMeta, useMeta };

dist/vue-meta.global.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-meta v3.0.0-alpha.4
2+
* vue-meta v3.0.0-alpha.5
33
* (c) 2021
44
* - Pim (@pimlie)
55
* - All the amazing contributors
@@ -315,7 +315,7 @@ var VueMeta = (function (exports, vue) {
315315
},
316316
set: (target, key, value) => {
317317
const success = Reflect.set(target, key, value);
318-
// console.warn(success, 'PROXY SET\nkey:', key, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
318+
// console.warn(success, 'PROXY SET\nkey:', key, '\nvalue:', value, '\npath:', pathSegments, '\ntarget:', isArray(target), target, '\ncontext:\n', context)
319319
if (success) {
320320
const isArrayItem = isArray(target);
321321
let hasArrayParent = false;
@@ -667,9 +667,8 @@ var VueMeta = (function (exports, vue) {
667667
target[key] = newSource[key];
668668
continue;
669669
}
670-
// We dont care about nested objects here , these changes
671-
// should already have been tracked by the MergeProxy
672670
if (isObject(target[key])) {
671+
applyDifference(target[key], newSource[key], oldSource[key]);
673672
continue;
674673
}
675674
if (newSource[key] !== oldSource[key]) {
@@ -702,7 +701,6 @@ var VueMeta = (function (exports, vue) {
702701
}
703702
if (vue.isProxy(source)) {
704703
vue.watch(source, (newSource, oldSource) => {
705-
// We only care about first level props, second+ level will already be changed by the merge proxy
706704
applyDifference(metaProxy.meta, newSource, oldSource);
707705
});
708706
source = source.value;

0 commit comments

Comments
 (0)