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

Update the plugin #9

Merged
merged 10 commits into from
Jun 28, 2018
Merged

Update the plugin #9

merged 10 commits into from
Jun 28, 2018

Conversation

homer0
Copy link
Owner

@homer0 homer0 commented Jun 28, 2018

What does this PR do?

Except for the HTML template functionality, I basically rewrote the entire thing:

Babel to the rescue!

Instead of using the ng-annotate-loader for webpack, it now uses the angularjs-annotate plugin for Babel:

  1. The loader is outdated.
  2. A generic solution like this is easier to maintain.
  3. projext already runs Babel, so now the transformation happens during the Babel process and not after it.
  4. Thanks to the new Babel helper, the logic that adds support for the annotation has been reduced to two small calls.

EVERYTHING is "private/protected" now

I'm doing this on several plugins and projext services now: Methods and properties that weren't intended to be used outside its class are now prefixed with an underscore (_), to mark them as "protected/private".

Sometimes I consider some methods/properties to be "ok" as "public" as they may be of utility for someone, but it wasn't until a few releases ago that I realized that by thinking that, changing those methods/properties, would require a breaking release, when there was no "real" reason for those things to be "public".

So, from now on, use events and reducers and try to stay away from methods and properties prefixed with underscore.

Dependencies up to date

All production and development dependencies were updated to their latest version.

Now, there's a special mention: ESLint. It latest version is v5, but the Airbnb preset I use is still not compatible with it, so I updated ESLint to the last version before v5: v4.19.1.

I also updated a few things on the .eslintrc after getting the Airbnb preset last version:

  • lines-between-class-members: I disabled this rule because I already fill the space between methods with comments, so I see not reason for it.
  • operator-linebreak: I changed the default value from the Airbnb, before, to after. The convention I use and which I believe is easier to read is with the operators at the end of the line.

hooks instead of install-hooks

The yarn/npm script to install the repositories hook has been changed to just hooks.

How should it be tested manually?

You need to use homer0/projext#next as version for projext and homer0/projext-plugin-webpack#next for projext-plugin-webpack.

This shouldn't be breaking, so try to build your AngularJS app using this branch, it should be fine.

And of course...

npm test
# or
yarn test

@coveralls
Copy link

Pull Request Test Coverage Report for Build 32

  • 27 of 27 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 30: 0.0%
Covered Lines: 53
Relevant Lines: 53

💛 - Coveralls

@homer0 homer0 merged commit 3499f77 into next Jun 28, 2018
@homer0 homer0 deleted the homer0_updatePlugin branch June 28, 2018 02:15
@homer0 homer0 added the on:next label Jun 28, 2018
@homer0 homer0 mentioned this pull request Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants