Skip to content
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

Don't let deepmerge merge instantiated objects #1534

Merged
merged 2 commits into from
Nov 8, 2020

Conversation

tivac
Copy link
Contributor

@tivac tivac commented Nov 7, 2020

Changes

Fixes #1416

Uses is-plain-object package and the isMergeableObject option in deepmerge to prevent it from copying properties around from non plain objects, which strips method off of class instances at the very least.

Testing

Docs

TODO: Should docs be updated for this? I'm not sure, but am happy to do that if it makes sense.

One for js config files, and one for instantiated objects
@vercel
Copy link

vercel bot commented Nov 7, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/g91izeq6v
✅ Preview: https://snowpack-git-config-merging.pikapkg.vercel.app

Copy link
Owner

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Appreciate the thorough testing 👍

@FredKSchott FredKSchott merged commit 0b3813f into FredKSchott:master Nov 8, 2020
@FredKSchott
Copy link
Owner

No need to update docs IMO, I see this more as a bug fix to something we probably should have been doing from the start

@tivac tivac deleted the config-merging branch November 8, 2020 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snowpack deepmerges plugin configs, destroying object instances
2 participants