Skip to content

Change Tutorial JavaScript code blocks to use Class Syntax #540

Closed

Description

@jenweber

We'd love to have a volunteer for this! Please see Octane MVP for instructions about where to make your PR. Please only volunteer for this issue if you can open a PR with at least part of the work by the end of the next day. Thanks for your help!

To-do

For this issue, we should only make "class syntax" changes to the code blocks within guides/release/tutorial markdown files. Later PRs will fix up the written explanations to go with them. Here's an example of converting to Class syntax:

// Before
import Controller from '@ember/controller';

export default Controller.extend({
  title: 'hello-world.app',
});
// After
import Controller from '@ember/controller';

export default class ApplicationController extends Controller {
  title = 'hello-world.app';
}
  • branch from the octane branch of the guides
  • See this guide's Native Classes explanation to learn about the changes you will have to make
  • Make changes to the code blocks to use class syntax
  • PR to the octane branch

Activity

  1. changed the title [-]Change JavaScript code blocks in the Tutorial to Class Syntax[/-] [+]Change JavaScript code blocks in the Tutorial to use Class Syntax[/+] on Mar 1, 2019
  2. added
    help wanted
    time-sensitive
    on Mar 1, 2019
  3. changed the title [-]Change JavaScript code blocks in the Tutorial to use Class Syntax[/-] [+]Change Tutorial JavaScript code blocks to use Class Syntax[/+] on Mar 1, 2019
  4. muziejus commented on Mar 1, 2019

    @muziejus
    Contributor

    I volunteer. Is that sufficient warning to ensure I don't stomp on someone else's work?

  5. jenweber commented on Mar 1, 2019

    @jenweber
    ContributorAuthor

    Yep! Thanks for the help! Let me know if you have any questions along the way.

  6. jamescdavis commented on Mar 1, 2019

    @jamescdavis
    Contributor

    I volunteer to CR this when the PR is opened. @muziejus, please ping me on the PR.

  7. muziejus commented on Mar 1, 2019

    @muziejus
    Contributor

    My one question so far, I think, is about whether I should also be adding decorators?

    export default class BlahComponent extends Component {
      actions = {
        handleClick() {
         // ...
        }
      }
    }

    looks odd to me. It wouldn't be much...

  8. rajasegar commented on Mar 1, 2019

    @rajasegar
    Contributor

    @muziejus Yes i think, should be

    export default class BlahComponent extends Component {
      @action
        handleClick() {
         // ...
        }
    
    }
  9. muziejus commented on Mar 1, 2019

    @muziejus
    Contributor

    OK, I'll add decorators then.

    Another question: tests fail on broken links outside of my realm… and the one inside my realm seems unfixable:

    3260 passing (5s)
      4 failing
    
      1) check all links in markdown files
           processing guides/release/components/block-params.md:
         AssertionError: [ { fileToFix: 'guides/release/components/block-params.md',
        badLink: '../passing-properties-to-a-component/' } ]: expected [ Array(1) ] to be empty
          at Context.<anonymous> (node-tests/link-checker.js:38:54)
    
      2) check all links in markdown files
           processing guides/release/components/wrapping-content-in-a-component.md:
         AssertionError: [ { fileToFix:
         'guides/release/components/wrapping-content-in-a-component.md',
        badLink: '../passing-properties-to-a-component/' } ]: expected [ Array(1) ] to be empty
          at Context.<anonymous> (node-tests/link-checker.js:38:54)
    
      3) check all links in markdown files
           processing guides/release/reference/syntax-conversion-guide.md:
         AssertionError: [ { fileToFix: 'guides/release/reference/syntax-conversion-guide.md',
        badLink:
         '../../components/passing-properties-to-a-component/#toc_positional-params' } ]: expected [ Array(1) ] to be empty
          at Context.<anonymous> (node-tests/link-checker.js:38:54)
    
      4) check all links in markdown files
           processing guides/release/tutorial/autocomplete-component.md:
         AssertionError: [ { fileToFix: 'guides/release/tutorial/autocomplete-component.md',
        badLink:
         '../../components/triggering-changes-with-actions/#toc_passing-the-action-to-the-component' } ]: expected [ Array(1) ] to be empty
    
  10. jenweber commented on Mar 1, 2019

    @jenweber
    ContributorAuthor

    Adding decorators would be awesome!

  11. jenweber commented on Mar 1, 2019

    @jenweber
    ContributorAuthor

    Regarding tests, go ahead and open a PR against Octane and we’ll figure out test failures later. We aren’t running CI against that branch yet, due to unfinished redirects

  12. rajasegar commented on Mar 1, 2019

    @rajasegar
    Contributor

    I figured out the test case failures, those are addressed here
    #552

  13. added a commit that references this issue on Mar 5, 2019
  14. muziejus commented on Mar 6, 2019

    @muziejus
    Contributor

    @jenweber With the merged PR #551, I think this is now closed?

  15. acorncom commented on Mar 14, 2019

    @acorncom
    Member

    @muziejus it looks like it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Octanehelp wantedtime-sensitive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions