Comments (4)
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.
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.
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.
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)
- Does not match field "body"
- Error `Error: Evaluation failed: TypeError: Cannot convert undefined or null to object` HOT 1
- TypeError: Cannot read property 'process' of undefined HOT 4
- `queryParams` needs to be an array
- Error when encountering ArrowFunctionExpression in computed setter HOT 2
- Codemod mistakes `computed.equal` for a modifier HOT 2
- Convert classic fields to prototype fields instead of class fields when run against an addon HOT 2
- ReferenceError: regeneratorRuntime is not defined if using babel.config.json
- Puppeteer version is not compatible with M1 Macs HOT 1
- I am getting `Ember is not defined` errors in a lot of the files
- Produces class decorator usage with incorrect syntax HOT 1
- codemod is removing async from methods HOT 1
- Codemod still mis-handling boolean CLI args as strings HOT 1
- Error count doesnβt match log.
- Unmodified when running codemod HOT 4
- Won't transform class with `actions` hash HOT 4
- Codemod is not working HOT 5
- Transformation error (Received an unexpected value [object Object])
- Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration HOT 3
- Error: `define is not defined` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-native-class-codemod.