Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Example of ES6/7 code transpilation #2564

Closed
1 of 3 tasks
rebloor opened this issue Dec 10, 2019 · 4 comments
Closed
1 of 3 tasks

Example of ES6/7 code transpilation #2564

rebloor opened this issue Dec 10, 2019 · 4 comments
Assignees
Labels
Content:WebExt Content related to Web Extensions Est:Large Task estimated as large (more than P1 bug; put in roadmap separately) P3 Fix when opportunity arises

Comments

@rebloor
Copy link
Collaborator

rebloor commented Dec 10, 2019

Request type

  • Please close this issue, I accidentally submitted it without adding any details
  • New documentation
  • Correction or update

Details

See mdn/webextensions-examples#97

@rebloor rebloor added P3 Fix when opportunity arises technical debt Est:Large Task estimated as large (more than P1 bug; put in roadmap separately) Content:WebExt Content related to Web Extensions labels Dec 10, 2019
@rebloor rebloor self-assigned this Dec 10, 2019
@rebloor
Copy link
Collaborator Author

rebloor commented Feb 18, 2020

@chrisdavidmills Given the rationale for removing react/ES6 examples in 398 I'm thinking that we shouldn't proceed with this one. Agree?

@chrisdavidmills
Copy link
Contributor

@rebloor I don't think we need a specific example of modern ES feature transpilation using babel, etc., or separate examples just for demonstrating JS feature usage in extensions, as those features are now all supported in Firefox, and we don't have cross-browser concerns with extensions.

Saying that however, I do think it'd be nice to include some example usage of those modern features in some of the extension examples, if possible. Can you start by looking at the examples and seeing if there is any example usage of async/wait, importants, etc.?

@rebloor
Copy link
Collaborator Author

rebloor commented Feb 19, 2020

@chrisdavidmills there do appear to be some example using these features, such as commands/options.js:

      */
      async function updateUI() {
       let commands = await browser.commands.getAll();
        for (command of commands) {
          if (command.name === commandName) {

Perhaps update the descriptions in examples.json to note something such as "includes uses of ES6/7 programming features.” Aside from async/wait and importance what else should I be looking out for all, where could I find a list of commands to check for? I found this: https://www.w3schools.com/js/js_es6.asp but it doesn't mention those features. Nor are they mentioned in https://www.freecodecamp.org/news/ecmascript-2016-es7-features-86903c5cab70/ Thoughts?

@chrisdavidmills
Copy link
Contributor

These lists aere useful:

Although I'm not sure why the later is archived. async/await is part of ES2017, IIRC.

I don't think you even need to put an explicit note on them, as it'd be annoying to maintain for future examples. Maybe it would be nice to show an example that uses imports, and then see if anything else is causing people specific difficulties in terms of their usage in extensions?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebExt Content related to Web Extensions Est:Large Task estimated as large (more than P1 bug; put in roadmap separately) P3 Fix when opportunity arises
Projects
None yet
Development

No branches or pull requests

3 participants