-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
eleventyComputed added via config does not follow deep data merge #3389
Comments
I’ll update the docs but The awkward part of config.addGlobalData("eleventyComputed.foo", () => {
return (data) => { /* stuff */ };
});
config.addGlobalData("eleventyComputed.bar", () => {
return (data) => { /* stuff */ };
}); I would like to improve that for The problem is this section right here: eleventy/src/Data/TemplateDataInitialGlobalData.js Lines 27 to 29 in e45040e
|
Oh, I forgot to say to your original point: I agree that we should merge objects passed to |
Merging of objects passed to |
One more note here is that this will happen independent of whether or not deep data merge is enabled. We’re trying to phase out/discourage use of the |
Docs are updated: https://www.11ty.dev/docs/data-global-custom/ |
Wow, that was fast! Color me impressed! |
(Thanks @DmitrySharabin for debugging this issue!)
I was using two plugins, both of which were doing something like this.
Plugin 1:
Plugin 2:
I expected that deep data merge should take care of merging the objects, but it turned out that each plugin was overriding the previous one.
a) This shouldn't happen and
b) Is there a better way for plugins to add global computed data?
The text was updated successfully, but these errors were encountered: