User:Vlsergey/WE-Framework 2.0

From Wikidata
Jump to navigation Jump to search

Hello, Wikidata community. Not-well-known WE-F gadget just released version 2.0. There is not a lot of changes outside, but internally it's a full rewrite. Details are following.

New features and secrets

[edit]
Aliases editing
  • Gadget supports aliases editing now.
  • There are some changes for datavalues editors:
    • Gadget will not break you data until the first edit of particular claim/qualifier. Old-version bug with quantities (when Wikidata team broken compatibility) will not happen. Thanks to redux library.
new time datavalue editor
    • Internal time datavalue editor now relies on Wikidata API for parsing and formatting of values.
    • wikidata-item editor:
      • will provide some image preview on search.
using one-of constraint (Q21510859) constain
      • will advice on allowed values for some properties if one-of constraint (Q21510859) constrain defined
      • still editor can select "other" option and enter any value
    • unsupported datatypes will still try to render existing values using Wikidata API (and will NOT break gadget).
qualifier-per-row editing mode
qualifier-per-column editing mode
    • There is no more "columns" modifier for claim editors. Claim editors will automatically switch from per-row view to table-view when some magic condition are met. For example, if you have 2-3 values for population (P1082) property you will see "standard" per-row editor. As soon as you have at least 5 values and at least 20% of them have single qualifier (i.e. point in time (P585)) editor will switch to table view. Magic.
    • There is no "flag" attribute for property editors. Flag will be automatically obtained from country (P17) reference of property.
    • There is no "search" attribute for property editors. Gadget will automatically take source website for the property (P1896) value and create a magic button for Google search.
SPARQL-based property tab
    • There is an additional SPARQL-group of properties. Now some editor tab can hold not a predefined set of properties, but a set of properties from SPARQL query. Very useful for quick-populated property sets like authority file (Q36524).
      • Same applies to external links editor. All tabs there are now SPARQL-groups.
      • Properties are sorted for your convenience. First goes properties with sites in your language, on second place is current project language, other are sorted by label.
  • Saving is now single request operation. You don't need separate request for removing claims (as in 1.x version). Well, you still need additional requests to set tags, but they are faster and safe to skip.
Enabled editors settings for we-framework
  • It is now possible to select which editors are enabled and which are not. Settings are stored in localStorage and bound to particular project. You can have different settings (enabled editors) on different projects.

Technology changes

[edit]
  • Instead of single JavaScript file new webpack+babel+(karma+mocha) build system is used. Non-minified version of gadget is 2.7 MiB!
    • Published version is minified to 850 KiB (before gzip). But it load faster than 1.0 version (because of webpack optimizations)
    • There are autotests. Not all scenarious are covered, but some are.
    • Gadget is rewritten with react+redux+reselect libraries. Some third-party libraries are "react-autosuggest", "react-tagsinput", "semantic-ui-react" (for popup) and... jQuery! Yes, mediawiki still relies on JQuery a lot. Dialogs and tabs are "native" JQuery widgets.
  • React is a fast rendering library (because of virtual DOM usage). But be aware of long tables. Some tabs (SPARQL-ones) may have >1400 different claims. They may require fast CPU.

How to migrate

[edit]

You don't need to do anything. Update script will handle it for you automatically.

How to try?

[edit]

Follow the white rabbit instructions.