Git Product home page Git Product logo

Comments (4)

ssutar avatar ssutar commented on May 25, 2024

What is the file name and type returned from the telemetry? As per the code we append the type to file name. This would happen if file name is router.js and telemetry type is router

I am not sure how much we can automate the class naming. Sometimes I think we should have a different codemod just to handle the naming of classes, given the different cases in naming an unnamed class πŸ˜„

from ember-native-class-codemod.

pzuraq avatar pzuraq commented on May 25, 2024

I think that falls within the domain of this codemod. We're trying to create the best experience possible for anyone updating an Ember app to to native class syntax, so figuring out the naming is part of that. This is something that should be scoped in nature, since Ember apps have strong conventions here. There are a finite number of edge cases to handle πŸ˜ƒ

In this case, there is only one router.js, so we should ignore it. This was also a larger problem, because it transpiled to the following:

import { get } from '@ember/object';
import { scheduleOnce } from '@ember/runloop';
import { inject as service } from '@ember/service';
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import RouterScroll from 'ember-router-scroll';

class RouterRouter extends EmberRouter.extend(RouterScroll) {
}

Router.map(function() {
});

export default Router;

Which broke, since only one of the symbols was transformed.

from ember-native-class-codemod.

ssutar avatar ssutar commented on May 25, 2024

What I meant by creating different codemods is, separating the part of code which handles naming from ember-object and putting it in different location under the same ember-es6-class-codemod So that it can be run post ember-object transformations.

The other issue in the example ^^ is same as #54 where we do not transform all the symbols

from ember-native-class-codemod.

pzuraq avatar pzuraq commented on May 25, 2024

Ah, I think that would be reasonable, separate them out structurally. They probably don't have to be completely separate codemods, just functions run sequentially in the same codemod, e.g. after this: https://github.com/ember-codemods/ember-es6-class-codemod/blob/master/transforms/ember-object/index.js#L17

from ember-native-class-codemod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.