Skip to content

WinterTC Minimum Common Web Platform API Alignment #10297

Open

Description

@NathanWalker

Is your feature request related to a problem? Please describe.

In addition to what the NativeScript runtimes provide, they should also provide all the common interfaces and global objects expected from any state of the art JavaScript runtime. WinterCG is a community group doing excellent work in this space to help runtime interoperability of APIs across runtimes.

Describe the solution you'd like

Ensure compliance with at least the minimum specification:

Interfaces:

Global methods / properties:

globalThis

Please accept these terms

Activity

  1. added
    feature-pending-triageA new feature request pending triage to confirm validity.
    and removed
    feature-pending-triageA new feature request pending triage to confirm validity.
    on May 25, 2023
  2. added this to the 9.0 milestone on May 25, 2023
  3. pinned this issue on Jan 9, 2024
  4. MrSnoozles commented on Feb 24, 2024

    @MrSnoozles

    @NathanWalker I needed queueMicrotask for the latest Vue Apollo Client to work. I polyfilled it using

    import queueMicrotask from "queue-microtask";
    global.queueMicrotask ??= queueMicrotask;

    which works perfectly. The queue-microtask library is effectively 5 lines of code, so that could be added easily as well.

  5. dangrima90 commented on Feb 26, 2024

    @dangrima90
    Contributor

    @NathanWalker I've a question about the polyfills that will be eventually implemented. I see that in the list above there's no mention of Intl API. My main point of interest is the NumberFormat class, as currently to support number formatting via .toLocaleString(), or be to able to use formatToParts(), polyfills have to be used (such as format js polyfills).

    Is this something out of scope for this update please?

  6. unpinned this issue on Mar 8, 2024
  7. NathanWalker commented on May 6, 2024

    @NathanWalker
    ContributorAuthor

    @dangrima90 Intl will be an optional package you could include when your app needs it vs. being built into runtime by default.

  8. jasongitmail commented on Jul 19, 2024

    @jasongitmail

    @NathanWalker Interesting to note (if only for others searching issues like me) that Intl.NumberFormat() partially works in the NativeScript runtime currently, making it seem buggy.

    I was attempting to use it to detect whether a dot or comma thousands separator should be used, but NativeScript always formats with a , thousands separator (for every locale I've tried), whereas the same code in Chrome on MacOS will use a dot thousands separator when appropriate for the locale.

      // const locale = Device.language; // e.g. 'en-US'
      // const locale = 'pt-BR'; // should use dot as thousands separator
      const locale = 'NL'; // should use dot as thousands separator
    
      // Format a number and extract the thousand separator
      const numberFormat = new Intl.NumberFormat(locale);
      const formattedNumber = numberFormat.format(1_000);
      const thousandSeparator = formattedNumber.charAt(1);
    
      console.log('locale', locale);
      console.log(`Formatted Number: ${formattedNumber}`);
      console.log(`Thousand Separator: ${thousandSeparator}`);

    Expected result (Chrome MacOS)

    chrome
  9. changed the title [-]WinterCG Minimum Common Web Platform API Alignment[/-] [+]WinterTC Minimum Common Web Platform API Alignment[/+] on Jan 17, 2025
  10. modified the milestones: 9.0, 10.0 on Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions