sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

πŸ™ SPFx v1.15 - please change default config to at least compile TS to ES6+

Open andrewconnell opened this issue 2 years ago β€’ 15 comments

What type of issue is this?

Question

What SharePoint development model, framework, SDK or API is this about?

πŸ’₯ SharePoint Framework

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

  • [ ] πŸ’₯ Internet Explorer
  • [ ] πŸ’₯ Microsoft Edge
  • [ ] πŸ’₯ Google Chrome
  • [ ] πŸ’₯ FireFox
  • [ ] πŸ’₯ Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [X] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • browser n/a
  • SPFx v1.15
  • Node.js v16

Issue description

SPFx v1.15 projects transpile TypeScript => ES5 (from 2009!). This is only necessary to support older browsers that don't support ES6. Since SPFx v1.15 only works in SPO, and since M365 no longer supports IE11, there's no need for this extra bloat in our generated bundles.

ES6 is supported on all M365 supported browsers.

Proposed change

Modify the existing ./tsconfig.json from...

{
  "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json",
  "compilerOptions": {
    "target": "es5",
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "jsx": "react",
    ...
  }
}

... to the following:

{
  "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json",
  "compilerOptions": {
    "target": "es6",
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "jsx": "react",
    ...
  }
}

BTW, this has no impact on my other issue about the ESLint rule for async/await (ref #8260)

andrewconnell avatar Jul 02 '22 11:07 andrewconnell

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jul 02 '22 11:07 ghost

Thanks @andrewconnell for bringing this up! We have some internal dependencies that slow down this kind of upgrade. But we're actively working on it.

AJIXuMuK avatar Jul 05 '22 16:07 AJIXuMuK

If you’re actively working on it, then why was this issue closed?

andrewconnell avatar Jul 06 '22 01:07 andrewconnell

@AJIXuMuK / @VesaJuvonen, do these "internal dependencies" still exist such that this cannot be completed?

mikevasiloff avatar Aug 25 '23 12:08 mikevasiloff

@mikevasiloff - yes, they still exist. Unfortunately, for now there is no ETA for the update to ES6

AJIXuMuK avatar Aug 25 '23 15:08 AJIXuMuK

@AJIXuMuK Are there any known issues from me just upgrading my project manually?

We're reviewing some internal best practices, and we've always said "leave the target as is" - but is there any reason I shouldn't bump it?

Tanddant avatar Aug 28 '23 12:08 Tanddant

@Tanddant - you can go and experiment with that. We don't list it as supported, meaning if anything goes wrong with your app - we're not responsible for the issues in that case.

AJIXuMuK avatar Aug 28 '23 13:08 AJIXuMuK

Hi @AJIXuMuK is there any update around supporting ES6 on SPFX ? thanks legend @andrewconnell for bringing this up.

pyromad13 avatar Dec 04 '23 10:12 pyromad13

I would like to register my interest in this question posed by @andrewconnell and the others above.

Is there any substantial reason/risk not to change to es6 target? Is this still being "actively" worked on 18 months later?

anthonywhite avatar Jan 08 '24 15:01 anthonywhite

+1 would love to see support for es6.

ynot3363 avatar Jan 10 '24 23:01 ynot3363

+1 here, we're nearing the 2 year anniversary of this issue. Will this be released in 2024?

parekhs-deshaw avatar Mar 12 '24 06:03 parekhs-deshaw