-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Dependencies prevent use with Angular #123
Comments
Hi, It's explained at the bottom of the documentation: I don't use Angular, but it's how I use it with my webpack projects! Regarding TypeScript, no, I didn't consider to convert to TypeScript. I don't even know how to And, yes, I still work there. There are only two Aymeric in France, and I'm not the Sales guy ;-) |
I see. Sorry I missed that. Unfortunately, the Angular team has obfuscated away any direct control over Webpack starting around Angular 6. Lots of folks aren't happy about it because of issues exactly like the one I am facing. Here is an interesting SO post where people talk about how this could really hamper using Angular CLI as a production system. I dunno if I would go that far :) What it does do is force package developers to really think about how they divide up their libraries and what dependencies they decide to rely on. I will try the JQuery plug-in called SPServices since Sharepointplus is not explicitly compliant with Angular CLI. If that doesn't work I will circle back and see about hacking the Webpack configuration. Have you thought about breaking the library into a client-only build and a client+node build? That would seem to be the "simple" solution (nothing's ever simple, though. Right? :) |
Actually, it looks like there may be a way to customize webpack after all. I am going to try it: |
The online documentation you refer to is not something that comes up here in the USA with a typical search. The github.com/Aymkdn/SharepointPlus page does not contain the webpack reference. However, I did find the info you referenced at the bottom of symkdn.github.io/SharepointPlus I think it would help others if the font of Webpack were increased a little. You could also put something like "Webpack (used by Angular)..." so that the search engines would pick it up. Cheers and thanks for the fast response! |
Yes, I may look at this at some point. I'd also like to split the library in smaller parts, to leverage tree shaking with Webpack. I just need time to work on it...
I can add a reference to Webpack on that page too and make it more clear that the README is only a very basic documentation.
I use Bootstrap, and it's true, they use 13px for the font-size when I usually use (at least) 14px. I'll increase it for next release.
Yeah, why not... But also VueJS (the one I use) and React I guess :-) I'll keep that issue opened to treat the above points when I'll release a new version. |
That's great feedback. Okay, I was able to get Angular to build by installing a couple of things.
`const WebpackNotifierPlugin = require('webpack-notifier'); module.exports = {
To use the library in Angular:
I will say that after all of this, I did manage to get this library working. Unfortunately, at this point I discovered that all of the results come back in a very heavy format with a TON of extra information, probably because SharePoint XML is returned from the native SP methods that are doing all of the heavy lifting. I would so love a way to get back only JSON values when requesting data from a list. Otherwise, I will have to write a lot of map commands to translate every value with a getAttribute() call. Maybe the use of the $SP().ajax or other raw command is the only answer. Hope all of this is helpful. I'd love to hear your thoughts. |
SharepointPlus is based on SOAP Webservices that return XML. The reason is that the WebService is far more powerful than the Rest (at least to get items from a list), offering some cool stuff not available yet with Rest. Also the library was originally built for SP2007 and back then, Rest wasn't a thing. The JSON returned by Rest is very noisy too, but certainly less. If you want something super simple, you can use Rest, but if you want to join several lists, play with calendars, use SQL syntax, and much more, SP will save you a lot of time. |
Definitely. I've built a lot of things on SharePoint and I find the apps scale a lot better on that platform if you can offload the processing to the client computers and avoid having the farm do too much joining and data manipulation considering it isn't a relational platform. But for platform-specific things like calendars, metadata, the search services, and especially workflow manipulation, the web services are definitely the way to go. Glad I got it all to work with Angular though. Hopefully this helps some people out. |
Just FYI...I was able to get PnP/sp to work with Angular without the customizations to Webpack or any server-side dependencies. It also returns JSON with its method calls which is primarily what I wanted since I'm dealing with a large volume of list data. Thanks again for your help. |
In the coming SharepointPlus v6.0 the |
I see where there is support for Node.js by using npm install sharepointplus. However, this will only compile for Node.js server-side due to the dependencies on node-sp-auth and sp-request.
I thought, ok, no problem. I will just reference the single sharepointplus-5.2.min.js file in my angular.json. Again, that fails to compile because of the dependency on sp-request.
So, I have two questions.
BTW, I don't know if you still work for Dell but I am doing a contract project for Dell at the moment and would like to use this library instead of SPServices plug-in for JQuery. Thanks!
The text was updated successfully, but these errors were encountered: