Yamato DaiwaFrontend (2.0.0-beta.4)

Version 2.0 (Beta)

Core Package (@yamato-daiwa/frontend)

New Functionality

Markup

Pug's Inline JavaScript
Functions and Classes
Assets

Styles

Assets

Breaking Changes

Styles

Assets
Renaming of NARROWEST_SCREEN_WIDTH_UNIT Constant

Constant NARROWEST_SCREEN_WIDTH_UNIT has been renamed to NARROWEST_SCREEN_WIDTH_UNIT--YDF.

Reason
To significantly reduce the probability of name conflict, the --YDF verndor postfix has been appended.
Changes in your code will required if
Your code has explicit usages of NARROWEST_SCREEN_WIDTH_UNIT constant.
Migration
Using the appropriate functionality of your code editor or IDE, replace all occurrences of NARROWEST_SCREEN_WIDTH_UNIT with mustThrowErrorIfElementNotFoundOrMatchesAreMultiple in all Stylus files of your project. For example, in IntelliJ IDEA family IDEs, such functionality could be invoked by Ctrl + Shift + R as default.
Renaming of DataTypes Enumeration and Some of its Elements
  1. DataTypes enumeration has been renamed to DataTypes--YDF.
  2. dimensionalAmount element has been renamed to dimensionalQuantity and its value to "DIMENSIONAL_QUANTITY".
  3. dimensionlessAmount element has been renamed to dimensionlessQuantity and its value to "DIMENSIONLESS_QUANTITY".
Reason
  • The --YDF vendor postfix has been appended to enumeration name to significantly reduce the probability of name conflict.
  • Elements has been renamed to unify to the canonical scientific terminology.
Changes in your code will required if
Your code has explicit usages of DataTypes enumeration.
Миграция

Using the appropriate functionality of your code editor or IDE, in all Stylus files of your project, replace all occurrences of:

  • DataTypes enumeration to DataTypes--YDF.
  • dimensionalAmount enumeration element to dimensionalQuantity.
  • dimensionlessAmount enumeration element to dimensionlessQuantity.

For example, in IntelliJ IDEA family IDEs, such functionality could be invoked by Ctrl + Shift + R as default.

The renaming of PracticalColorCoordinateSystem two-level object

To reduce the name conflict probability, vendor postfix has been added to the objet PracticalColorCoordinateSystem, and not it the PracticalColorCoordinateSystem--YDF.

Changes two-level object TemporaryHighlighting
  • Object has been renamed to TemporarySemitransparentHighlighting--YDF.
  • Now the ultrashort properties line o25, which meaning could not be understood without the documentation or checking of the output CSS code has been replaces with meaningful, such as opacity25Percent.
Reasons
  • The «transparent» word has been added to increase the unambiguity.
  • To vendor postfix --YDF has been added to the to significantly reduce the name conflict probability.
  • The properties of the second level has been renamed because basically all libraries of Yamato Daiwa vendor does not accept the names which meaning could not be understood wihtout the documentation, so now this rule has been applied to TemporarySemitransparentHighlighting--YDF object even though it is not intended to be used in production code.
Changes of your code will require if
You, contrary to the recommendation to not use this object in the clean copy of stylesheet did it, or you has updated the YDF during the writing of the draft CSS code where used the TemporaryHighlighting object.
Migration

Using the appropriate functionality of your code editor or IDE, execute the following replacements in all Stylus files.

  • TemporaryHighlightingTemporarySemitransparentHighlighting--YDF
  • .o10.opacity10Percent
  • .o25.opacity25Percent
  • .o50.opacity50Percent
  • .o75.opacity75Percent
The renaming of ShadesOfGray__39ColorsW3C_Palette array

The ShadesOfGray__39ColorsW3C_Palette array has been renamed to W3C_39_ShadesOfGray--YDF.

Core
Replacing of the Basic Variables with Configuration Object

The following basic variables (as they has been called in 1.X versions) has been replaced with YDF_Configuration object or deleted for the following reasons.

MAIN_FONT_STACK
Replaced with YDF_Configuration.fontsStacks.main
MAIN_SANS_SERIF_FONT_STACK
Replaced with YDF_Configuration.fontsStacks.mainSansSerif
MAIN_SERIF_FONT_STACK
Replaced with YDF_Configuration.fontsStacks.mainSerif
MAIN_MONOSPACED_FONT_STACK
Replaced with YDF_Configuration.fontsStacks.mainMonospaced
BASIC_FONT_SIZE
Replaced with YDF_Configuration.textGeometry.basicFontSize
BASIC_LINE_HEIGHT
Replaced with YDF_Configuration.textGeometry.basicLineHeight
BASIC_LINE_HEIGHT_IN_MULTILINE_TEXT_BLOCKS
Replaced with YDF_Configuration.textGeometry.basicLineHeightInMultilineTextBlocks
BASIC_FONT_SIZE_IN_MULTILINE_TEXT_BLOCKS
Deleted because there is no need inside YDF in new font size only for the multiline elements in addition to YDF_Configuration.textGeometry.basicFontSize
BEM_ELEMENT_SEPARATOR
Deleted because not  using in YDF anymore
BEM_MODIFIER_SEPARATOR
Deleted because not  using in YDF anymore
ZIndexes
Replaced with YDF_Configuration.zIndexes
Why has been replaced to configuration object

The variables had too common names and nothing has indicated that they are coming from YDF. To solve the last these problems, it was possible to append the vendor postfix to variables (for example, MAIN_SANS_SERIF_FONT_STACK could become to MAIN_SANS_SERIF_FONT_STACK--YDF this way), but the object-type variable is better for the storing of configuration.

Changes of your code will require if
You have directly used one or more of mentioned above variables
Migration
  • If you want to continue to use the basic variables with same names as previously, define them yourself with desired values.
  • If you have overridden the basic variables then it is required to override the YDF_Configuration object instead.
  • If you are fine with usage of the YDF_Configuration object instead of the of the basic variables, then replace the references to these variables with the accessing to the corresponding properties of the YDF_Configuration object. But please note that this object as it is clear from its name is intended for the configuration of the YDF functionality and this library is just the utility in your project. So, if you have the unique design, then the settings related with this design recommended to define independently on YDF, and let YDF_Configuration object properties refers to the settings of your design.