Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-1320

Allow optional chaining in Nuxeo Elements

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.2
    • Fix Version/s: None
    • Component/s: Tooling

      Description

      Currently, optional chaining is supported by all the browsers supported by Web UI and Elements.
      However, when using optional chaining, polymer lint returns a warning as follows:

      ui/nuxeo-document-picker/nuxeo-document-picker.js(NaN,NaN) error [parse-error] - This experimental syntax requires enabling the parser plugin: 'optionalChaining' (172:31)
      

      As far as I can tell, there's no way to easily toggle this flag easily. After a bit of research I found that there are some people trying to use a babel plugin for this (@babel/plugin-proposal-optional-chaining), but it isn't helpful since I could not find a way to specify plugins for polymer lint.
      The goal would be to setup linting so that optional chaining can be used and review the existing elements to apply it whenever possible.
      Note: If this is possible for Elements, the next step would be to also allow it in Web UI.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mnixo Miguel Nixo
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: