config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* @flow */
  2. import { no } from 'shared/util'
  3. export type Config = {
  4. preserveWhitespace: boolean,
  5. optionMergeStrategies: { [key: string]: Function },
  6. silent: boolean,
  7. isReservedTag: (x?: string) => boolean,
  8. isUnknownElement: (x?: string) => boolean,
  9. mustUseProp: (x?: string) => boolean,
  10. _assetTypes: Array<string>,
  11. _lifecycleHooks: Array<string>,
  12. _maxUpdateCount: number,
  13. _isServer: boolean,
  14. _ctors: Array<Function>
  15. }
  16. const config: Config = {
  17. /**
  18. * Preserve whitespaces between elements.
  19. */
  20. preserveWhitespace: true,
  21. /**
  22. * Option merge strategies (used in core/util/options)
  23. */
  24. optionMergeStrategies: Object.create(null),
  25. /**
  26. * Whether to suppress warnings.
  27. */
  28. silent: false,
  29. /**
  30. * Error handler for watcher errors
  31. */
  32. errorHandler: null,
  33. /**
  34. * Check if a tag is reserved so that it cannot be registered as a
  35. * component. This is platform-dependent and may be overwritten.
  36. */
  37. isReservedTag: no,
  38. /**
  39. * Check if a tag is an unknown element.
  40. * Platform-dependent.
  41. */
  42. isUnknownElement: no,
  43. /**
  44. * Check if an attribute must be bound using property, e.g. value
  45. * Platform-dependent.
  46. */
  47. mustUseProp: no,
  48. /**
  49. * List of asset types that a component can own.
  50. */
  51. _assetTypes: [
  52. 'component',
  53. 'directive',
  54. 'transition',
  55. 'filter'
  56. ],
  57. /**
  58. * List of lifecycle hooks.
  59. */
  60. _lifecycleHooks: [
  61. 'init',
  62. 'created',
  63. 'beforeMount',
  64. 'mounted',
  65. 'beforeUpdate',
  66. 'updated',
  67. 'beforeDestroy',
  68. 'destroyed',
  69. 'activated',
  70. 'deactivated'
  71. ],
  72. /**
  73. * Max circular updates allowed in a scheduler flush cycle.
  74. */
  75. _maxUpdateCount: 100,
  76. /**
  77. * Server rendering?
  78. */
  79. _isServer: process.env.VUE_ENV === 'server',
  80. /**
  81. * Keeping track of all extended Component constructors
  82. * so that we can update them in the case of global mixins being applied
  83. * after their creation.
  84. */
  85. _ctors: []
  86. }
  87. export default config