cwadrupldijjit / ng2-parallax

A parallax plugin/directive for Angular 2. Learn more at:
http://cwadrupldijjit.com/ng2-parallax
MIT License
29 stars 18 forks source link

Add new enviroment #8

Closed MurhafSousli closed 5 years ago

MurhafSousli commented 7 years ago

Hi @cwadrupldijjit, here is a new environment which:

The updates are:

updating the old usage like this:

import {ParallaxModule} from '../parallax';

@NgModule({
  imports: [
    ParallaxModule
  ]
})

makes it possible to include more parallax directives to the package in future

Building & Publishing

1 - increment version 2 - gulp build 3 - npm publish ./dist

Cheers!

cwadrupldijjit commented 7 years ago

@MurhafSousli I will try this out shortly. I've had little time to check it out since you put in the PR, but time is a lot more free lately.

cwadrupldijjit commented 7 years ago

@MurhafSousli: Would this work just fine with webpack builds, too? That had been an issue before, and I haven't tested this directive with webpack for quite some time.

If this works fine universally, I'll have to update some documentation, as well.

MurhafSousli commented 7 years ago

@cwadrupldijjit I updated my build system, copy the following files from this repo:

and inside gulpfile.js just replace ng2-progressbar with ng2-parallax and ng2Progressbar with ng2Parallax

remove rxjs dependencies in gulp.js since you don't use it (not necessary because it won't add anything to your dist)

you should also update the dependencies in your package.json file from that one in the repo and your build system is ready to support both webpack and systemjs

Note that the linter inside will force you to align your code I found it annoying at the beginning but it turned out to be really cool.

I also recommend you to refactor the parallax directive and use only renderer to manipulate the DOM. this way you will get your directive to work everywhere using the angular way

cwadrupldijjit commented 7 years ago

I will have to update the parallax directive to a more modern way of doing it--as this was written pre-release, I didn't have the renderer api to work with, but it should be good, and not difficult to use when I update it to use that.

When pulling your code to check if it will work on my Windows machine, I ran into a problem with the ngc gulp task, where since there was a space in my file path, it thought I was trying to run a program partway through the path. I can fix it, if you don't mind me pushing to your fork with the fix, so it can be in this PR.

cwadrupldijjit commented 7 years ago

Otherwise, I can include the fix in another update.

crutchcorn commented 6 years ago

Any progress on this @cwadrupldijjit?

cwadrupldijjit commented 6 years ago

I never got a response about this from @MurhafSousli. I have a few fixes I'll have to do on my end before I accept it, as this was set up in a posix environment, whereas I use a win32 environment.

I think it's fairly well put together, I've just been very busy and then forgotten about it. (One of the worst possible things to do with open-source projects, I know. :( )

MurhafSousli commented 6 years ago

Hi @cwadrupldijjit, it is been a while :) I recommend you use this library generator for setting up the environment

cwadrupldijjit commented 6 years ago

Not a bad idea. Have you heard about the future plans of @angular/cli, where it could do a similar thing? I hope that they come through with that--that would make life a whole lot easier!

In the meantime, I'll just ensure that the changes I have work, and then merge these changes.

It will likely include changes to the readme, so that it doesn't say it doesn't work with Webpack anymore.

cwadrupldijjit commented 5 years ago

The environment has changed to ensure that the directive works in the latest version of Angular and it's generated via the Angular CLI. Closing this and deferring any further conversation on this package to the new repo: cwdj-parallax