-
Notifications
You must be signed in to change notification settings - Fork 46
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
question about what compressor does for me... #82
Comments
Yeah, thats how Ive been working towards as well for the last week. Unfortunately Ive been pretty sick too, but my important takeaway is that:
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread. |
Great. I am not alone. :) Thanks for confirming. Right now I am in the process of migrating to requireJS. Once that is done, I will turn my attention to the bundling.
Ok. That shouldn’t be a problem. I am only using the import X = require(‘x’) format for 3rd party libraries.
Ah that’s good to know. I think I managed to get the compressor to run once and I had jQuery in a bundle but I was getting an error. I thought it very strange that it would error out on jQuery.
|
Hi @aquamoth I think we may be pushing in the wrong direction. Now that I have a clearer understanding of the tool and I understand the terms better, I have re-read the bundling page. The example they show is assuming that there is a single bundle per "Area", not per "Action", which is a huge difference. I need to keep reading, but for right now it doesn't even look possible to automate creating a bundle per page (action). I think I would have to add a new config file entry for every page I create. This is the kind of maintenance I was hoping to avoid. I guess I could go back and start breaking down my app into fairly small "Areas". |
Hi @aquamoth Were you running into errors like this:
Notice the last part of the path is FrontDeskFrontDesk.js. There should be a slash between FrontDesk and FrontDesk.js. I believe it is picking this up from a require statement that the Typescript compiler created:
|
Yeah, the autobundling’s entire path system is totally broken. Im rewriting it but had too much sick kids the last two weeks to finish it.
When I do I will push my branch and make a pull-request. Im not sure they take it though since it is some major rewriting including unit-testing, but then there is always my branch to use….
/Mattias
Från: gregveres [mailto:notifications@github.com]
Skickat: den 25 november 2016 09:26
Till: vtfuture/RequireJSDotNet <RequireJSDotNet@noreply.github.com>
Kopia: Mattias Åslund <mattias@trustfall.se>; Mention <mention@noreply.github.com>
Ämne: Re: [vtfuture/RequireJSDotNet] question about what compressor does for me... (#82)
Hi @aquamoth <https://github.com/aquamoth>
Were you running into errors like this:
RequireJsNet.Compressor.2.2.5\build\RequireJsNet.Compressor.targets(33,5): error : Could not load script C:\Users\gregv\Source\Repos\SquashSpider\SquashSpider\SquashSpider\Scripts\App\FrontDeskFrontDesk.js
Notice the last part of the path is FrontDeskFrontDesk.js. There should be a slash between FrontDesk and FrontDesk.js.
I believe it is picking this up from a require statement that the Typescript compiler created:
define(["require", "exports", 'App/FrontDesk/FrontDesk'], function (require, exports, FrontDesk_1) {
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#82 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AFNKNxJNg5-XdmzT5eOjmjQfkvd_GbFaks5rBkc0gaJpZM4K3FOH> . <https://github.com/notifications/beacon/AFNKN0PnnBD6VnZIWkqeA-Q46x6njz1iks5rBkc0gaJpZM4K3FOH.gif>
|
Im not sure we are trying for the exact same level of bundling.
I want a global bundle, an area bundle and possibly some page-specific scripts, that I may or may not bundle depending on how many they are.
I assume I will just make an autobundle entry for each bundle I need, but I don’t think it would be hard to provide a directory of entrypoints and tell it to make a bundle for each entrypoint, if that is what you really need/want.
I AM a bit worried there will be more code to download to clients with the latter setup though, since each page will load its own bundle with a lot of overlapping scripts. But your mileage may vary.. :)
/Mattias
Från: gregveres [mailto:notifications@github.com]
Skickat: den 25 november 2016 09:18
Till: vtfuture/RequireJSDotNet <RequireJSDotNet@noreply.github.com>
Kopia: Mattias Åslund <mattias@trustfall.se>; Mention <mention@noreply.github.com>
Ämne: Re: [vtfuture/RequireJSDotNet] question about what compressor does for me... (#82)
Hi @aquamoth <https://github.com/aquamoth>
I think we may be pushing in the wrong direction. Now that I have a clearer understanding of the tool and I understand the terms better, I have re-read the bundling page <http://requirejsnet.veritech.io/compressor.html> . The example they show is assuming that there is a single bundle per "Area", not per "Action", which is a huge difference.
I need to keep reading, but for right now it doesn't even look possible to automate creating a bundle per page (action). I think I would have to add a new config file entry for every page I create. This is the kind of maintenance I was hoping to avoid.
I guess I could go back and start breaking down my app into fairly small "Areas".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#82 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AFNKN1HGYocI-pzUHikZuEURj3u1ZQyOks5rBkVRgaJpZM4K3FOH> . <https://github.com/notifications/beacon/AFNKNy-pyxMe1zbPwj3h_ES0yWLQ3WYLks5rBkVRgaJpZM4K3FOH.gif>
|
@aquamoth thank you for carrying on the conversation with me. I am trying to learn from others so you sharing how you are doing things is very helpful to me. I appreciate it. I wouldn't mind hearing from @rangp. He has created a fork of this project to fix the compressor as well. I have to assume that he fixed the bugs in the path system, but he says he is using the MVC bundling system to ensure cache busting. Ok I see what you are saying. I think my reason for bundling is to minimize the JS code (through uglify) and then to minimize the number of round trips to the server. I could see that by bundling too high up in the hierarchy you end up delivering too much code to the browser if the user isn't fully exploring that area of the product. And to avoid that you might create very fine grained Areas within your source tree. So your classification of bundles comes down to:
I was thinking about the problem a little differently. I believe the shared scripts on a page are due to shared components being used on multiple pages. If I am correct, then I would like to have the ability to create a bundle from the support scripts for a component. I am using Typescript and single responsibility principle so one component sometimes ends up spanning multiple files. I would like to create a bundle for each component. Then there is always going to be the page's view model script that is specific to that page. So I was looking for a solution that does the following:
I don't want to load any unbundled scripts. It is the minimization of the script that is just as important to me as the joining of the minimized script with other scripts. Right now I am using MVC's bundling to bundle my global scripts outside of requireJS and RequireJSNet. I would prefer to pull them into the same structure but that's only because I don't like exceptions. :) |
Hi
I might have the wrong impression of what autoCompressor does for me.
I assume like everybody else here, I am using MVC to serve up different pages. Each of these pages is pretty much its own SPA with a fair bit of typescript /javascript code spread across many files.
From my initial reading of this project, I was assuming that autoCompressor would analyse each page's javascript and build a bundle per MVC page. The end result would be that each MVC page did one round trip to the server to pull all the needed javascript in a single minimized file. And that this minimized file would contain just the javascript for that MVC page.
Is that the case? If so, I don't understand the autoBundler configuration to achieve that.
I have my typescript files organized this way:
Scripts/
-> Api // files that provide me access to my MVC Web Api back end (models and functions that do ajax calls)
-> App // MVVM view model classes broken out per page, but there could still be some sharing here
-> Controllers // the initial kick off typescript file per Controller Action - this is new since adopting this project
-> Libs // 3rd party libraries I am using.
I guess I am expecting to get to a point where I could have a common include for the app (say jquery, bootstrap and knockout or angular), and then for the controller Actions: Home/Action1 and Home/Action2, I would have two bundles automatically created based on the smallest subset of my typescript code, one called Home/Action1Bundle.js and the other called Home/Action2Bundle.js.
Am I thinking about this correctly?
Thanks a lot
Greg
The text was updated successfully, but these errors were encountered: