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

Add the warning that the domData.get functionality with the set functionality will be deprecated in the major release #364

Open
matuzalemsteles opened this issue Mar 9, 2018 · 2 comments

Comments

@matuzalemsteles
Copy link
Contributor

Hey guys,

Since domData.set has been added and the domData.get functionality has been set to set so that we do not have a breaking change, it would be important to add warnings that the next major release will depreciate this feature.

Something like:

static get(element, name, initialValue) {
	if (!element[METAL_DATA]) {
		element[METAL_DATA] = {};
	}
	if (!name) {
		return element[METAL_DATA];
	}
	if (!isDef(element[METAL_DATA][name]) && isDef(initialValue)) 
		console.warn('domData: get with the set functionality will be deprecated and removed in the next major releases.');
		element[METAL_DATA][name] = initialValue;
	}
	return element[METAL_DATA][name];
}

What do you think?

@diegonvs
Copy link
Contributor

I think that we can try use this transform https://www.npmjs.com/package/babel-plugin-log-deprecated, what do you think?

@matuzalemsteles
Copy link
Contributor Author

Hey @diegonvs how we talk it off, being a library no longer maintained maybe not ideal and covers few use cases. In this case it's just showing a warning when you use the set functionality inside get.

I do not think we need to try to automate this, just show a friendly message to the developer 🙂.

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

No branches or pull requests

2 participants