Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25816

Decide on best practices for polyfilling for ES6+ usage

    Details

    • Type: Story
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: node-titanium-sdk 0.4.12
    • Component/s: None
    • Labels:
      None

      Description

      Description

      I'm making this a story because to me it's something that we need to investigate, discuss and act on

      With the addition of babel in 7.1.0 users can now use new syntax in their applications without worrying about what their targets support. While that is the theory it's not the reality.

      If you review Babels Learning ES2015 guide, some features denote Support via polyfill, this is because babel can only handle syntactical changes (arrow function to function expressions, let/const to var etc.), and for features such as maps and promises it is impossible to transpile these down so babel makes use of polyfills, which instead add these into the JS environment.

      To me, there are a two avenues to us handling this

      This has been attempted already (kind of) in two ways

      Here's my first thoughts on drawbacks I see with both ways

      • User owned
        • Doesn't adhere with our current way of handling this kind of thing where we deal with it
      • SDK owned
        • Unless we're detect what's needed every app will include it, whether they need it or not.
        • We'll need to continually maintain this each release I believe

      I looked at how others handle this, and discovered the following

      • react-native rolls its own preset, which appears to be dynamic dependent on an apps usage. Polyfills look to be baked into react-native with them being defined when the app start

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                eharris Ewan Harris
                Reviewer:
                Christopher Williams
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6211
                    Sync status:
                    PENDING
                    Last received:
                    Last sent:

                    Git Integration