deprecations.js 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. if (process.env.NODE_ENV !== 'production') {
  2. var _ = require('./util')
  3. var warn = function (msg) {
  4. _.warn('{DEPRECATION} ' + msg)
  5. }
  6. _.deprecation = {
  7. REPEAT_ALIAS: function () {
  8. warn('v-repeat alias (e.g. item in items) will be required in 1.0.0.')
  9. },
  10. ADD: function () {
  11. warn('$add() will be deprecated in 1.0.0. Use $set() instead.')
  12. },
  13. WAIT_FOR: function () {
  14. warn('"wait-for" will be deprecated in 1.0.0. Use `activate` hook instead.')
  15. },
  16. STRICT_MODE: function () {
  17. warn('Strict mode will default to `true` in 1.0.0.')
  18. },
  19. CONTENT_SELECT: function () {
  20. warn('<content select="..."> will be deprecated in in 1.0.0. in favor of <slot name="...">.')
  21. }
  22. }
  23. // ensure warning get warned only once
  24. var warned = {}
  25. Object.keys(_.deprecation).forEach(function (key) {
  26. var fn = _.deprecation[key]
  27. _.deprecation[key] = function () {
  28. if (!warned[key]) {
  29. warned[key] = true
  30. fn()
  31. }
  32. }
  33. })
  34. }