Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from component to webpack #94

Merged
merged 7 commits into from
Jan 14, 2020
Merged

Move from component to webpack #94

merged 7 commits into from
Jan 14, 2020

Conversation

ccyrille
Copy link
Contributor

Executing a make build on the master, even by removing disappeared dependencies like kpwebb/select2, I got the following :

installed : component/querystring@2.0.0 in 495ms
   installed : components/handlebars.js@v4.1.2 in 471ms
   installed : component/trim@0.0.1 in 531ms
   installed : component/type@1.1.0 in 584ms
   installed : es-shims/es5-shim@v4.5.13 in 666ms
   installed : es-shims/es6-shim@0.35.5 in 545ms
   installed : trevorgerhardt/haversine@master in 478ms
     install : complete


       build : resolved in 21ms

fs.js:128
  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:128:9)
    at Object.writeFile (fs.js:1158:14)
    at /Users/cyrille/WORKSPACE/otp.js/node_modules/component/bin/component-build:225:8
    at /Users/cyrille/WORKSPACE/otp.js/node_modules/component-build/lib/styles.js:14:5
    at /Users/cyrille/WORKSPACE/otp.js/node_modules/component-builder/lib/builders/builder.js:142:9
    at next (/Users/cyrille/WORKSPACE/otp.js/node_modules/chanel/lib/proto.js:258:5)
    at Function.onevent (/Users/cyrille/WORKSPACE/otp.js/node_modules/chanel/lib/proto.js:194:9)
    at Object.onceWrapper (events.js:277:13)
    at Function.emit (events.js:189:13)
    at /Users/cyrille/WORKSPACE/otp.js/node_modules/chanel/lib/proto.js:142:10
make: *** [build] Error 1

Problem appears to be at the heart of component package manager, which is not maintained since 2015 (see componentjs/component#639). I decided to migrate the whole project to webpack, sticking as much as possible to the current implementation.

This also solve the following issue : #91

@ccyrille ccyrille marked this pull request as ready for review May 15, 2019 10:13
@ccyrille ccyrille changed the title Feature/move to webpack Move from component to webpack May 15, 2019
Copy link
Contributor

@landonreed landonreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ccyrille, this looks great and is long overdue! I just had a couple of small nitpicky items regarding whitespace and dependencies.

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.1/backbone-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet-src.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.4/raphael-min.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the whitespace here to be spaces and align with the above script tag?

package.json Outdated
"inquirer": "^6.3.1",
"jquery": "^1.11.3",
"leaflet": "^0.7.3",
"loadash": "^1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be lodash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, and in fact I wasn't using it anymore so I simply removed it ;)

package.json Outdated
"haversine": "^1.1.1",
"html-loader": "^0.5.5",
"inquirer": "^6.3.1",
"jquery": "^1.11.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A number of these dev dependencies seem to actual dependencies rather than dev dependencies. For example, bootstrap, jquery, backbone, eonasdan-bootstrap-datetimepicker, underscore, moment.

'window.L': 'leaflet',
'$': 'jQuery'
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the html file, could you use spaces here instead of tabs to conform with the rest of the project (two spaces per indentation)?

package.json Outdated
},
"scripts": {
"start": "serve client",
"watch": "webpack --watch",
"webpack": "webpack",
Copy link
Contributor

@landonreed landonreed Jul 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more intuitive name for this webpack script to me is build. It keeps the command build tool-independent and is more of a conventional name. I suppose the Makefile would also need to change accordingly.

@ccyrille
Copy link
Contributor Author

ccyrille commented Aug 6, 2019

Hi @landonreed, thanks for your nice review ! I agree with all the recommandations you made, and pushed the associated changes. Don't hesitate to come back to me if needed...

@ccyrille
Copy link
Contributor Author

Sorry to bother you @landonreed but any chance you can review this PR ? Do you need me to do additional work from me ?

@ccyrille
Copy link
Contributor Author

Hi @demory @trevorgerhardt, sorry to bother you but I am stuck here. I have put some effort making the otp.js usable / maintainable again by moving to webpack, but I haven't here from Landon since then. Could you help ?

@trevorgerhardt
Copy link
Member

Hi @ccyrille. We no longer maintain this project as we don't use it internally anymore. It appears the OpenTripPlanner project has mostly moved on from it also with https://github.com/opentripplanner/otp-react-redux and https://github.com/opentripplanner/otp-ui.

The next merged PR should probably be an update relating to the status of this project pointing users to more active client side OTP libs and a more up to date repo for this project.

@ccyrille
Copy link
Contributor Author

ccyrille commented Jan 14, 2020

Hi @trevorgerhardt, hoping that I didn't work for nothing :

  • would it be possible to have this PR merged anyway, as it has been fully reviewed and at least it makes the project usable for someone that would want to ? I have remove conflits with master so there is no overhead for you.
  • could you soon update the README so other people don't face the same problem I did ?

Thanks, Cyrille

@trevorgerhardt trevorgerhardt merged commit cb50450 into conveyal:master Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants