These are chat archives for canjs/canjs

19th
Aug 2016
Christopher Oliphant
@RALifeCoach
Aug 19 2016 00:53
Any luck with that?
Kevin Phillips
@phillipskevin
Aug 19 2016 01:01
yeah, I was able to reproduce it by just creating an html file that loads steal with a cache buster similar to how karma does it: <script src="./node_modules/steal/steal.js?541225d08418bb4185e186840ac3f6c72470ff3e"></script>
Christopher Oliphant
@RALifeCoach
Aug 19 2016 01:02
does that mean you were able to get the test to run?
Kevin Phillips
@phillipskevin
Aug 19 2016 01:02
no
oh
I got karma to run, yeah
and changed the browser to firefox
Christopher Oliphant
@RALifeCoach
Aug 19 2016 01:03
and show the jasmine output?
Kevin Phillips
@phillipskevin
Aug 19 2016 01:03
no, it still fails with the same error
Kevin Phillips
@phillipskevin
Aug 19 2016 01:22
steal sets whatever is on the query param of the steal script tag as System.main
I’m not sure if it’s alway done that
might be worth opening an issue
Christopher Oliphant
@RALifeCoach
Aug 19 2016 01:23
but my file didn’t have a query param
Kevin Phillips
@phillipskevin
Aug 19 2016 01:23
yeah, Karma appends one
Christopher Oliphant
@RALifeCoach
Aug 19 2016 01:24
right - what if you append the actual main file name?
Kevin Phillips
@phillipskevin
Aug 19 2016 01:25
then their glob pattern breaks
karma.png
18 08 2016 20:25:57.565:INFO [Firefox 47.0.0 (Mac OS X 10.11.0)]: Connected on socket /#E_x2IhUavpKxCIAEAAAA with id 93396999
18 08 2016 20:25:58.059:WARN [web-server]: 404: /base/e9864da5cfc8ad5eddeb7342f526c63f6820478e/e9864da5cfc8ad5eddeb7342f526c63f6820478e.js
so that’s what led me to try
yeah, I was able to reproduce it by just creating an html file that loads steal with a cache buster similar to how karma does it: <script src="./node_modules/steal/steal.js?541225d08418bb4185e186840ac3f6c72470ff3e"></script>
Kevin Phillips
@phillipskevin
Aug 19 2016 01:34
maybe someone on the steal channel can help think of a way to prevent this until you can set the System.main in the karma bootstrap file
Thomas Sieverding
@Bajix
Aug 19 2016 04:20
This hook is supposed to be called when I call save no?
connect.behavior('update-diff', function( baseConnect ) {
  return {
    updateData: function() {
      debugger
    }
  };
});
Julian
@pYr0x
Aug 19 2016 07:47
@Bajix you hadd the behavoir to the connect?
Julian
@pYr0x
Aug 19 2016 07:57
@phillipskevin https://github.com/stealjs/steal/blob/major/src/startup.js#L26-L36 , but this is only for webworkers
maybe you can make a workaround by adding another silly param to the steal script like <script src="./node_modules/steal/steal.js?foo=bar&bar=foo&541225d08418bb4185e186840ac3f6c72470ff3e"></script>
Kevin Phillips
@phillipskevin
Aug 19 2016 13:35
@pYr0x the problem is the script tag is injected by karma, there’s no way to add other params to the tag
Julian
@pYr0x
Aug 19 2016 13:41
oh ok
Sunil George
@georgesunil81
Aug 19 2016 15:34
A quick question if someone can answer please - I am using CanJS and StealJS for my application. But everytime I make changes to my JS files and deploy it to production, the users don't see the changes I made (their browsers still use the cached JS files that do not carry my latest changes). What do I do to make sure that their browsers reload the JS files whenever I do a production deployment? I am stuck on this problem. Please let me know.
Also, I must add that I am using steal-tools to create the production build for deployment.
Kevin Phillips
@phillipskevin
Aug 19 2016 15:35
what are you deploying to?
Sunil George
@georgesunil81
Aug 19 2016 15:35
An IIS web server
Kevin Phillips
@phillipskevin
Aug 19 2016 15:36
Sunil George
@georgesunil81
Aug 19 2016 15:36
Hmmm...thanks @phillipskevin for the link. I will check it out ASAP.
@phillipskevin Had a quick read through, it looks like the steal-cache-bust was specifically developed to handle the issue I described!
Kevin Phillips
@phillipskevin
Aug 19 2016 15:38
yep
there are lots of other ways to change how IIS caches static files, but not sure how much control you have over server settings
Sunil George
@georgesunil81
Aug 19 2016 15:39
Thanks @phillipskevin . Now I am trying to figure out how to use it in my project. Will do, will let you know if I have any questions.
Sure, thanks @phillipskevin . I don't have any control over the IIS server settings. So, I will have to rely on steal-cache-bust
Kevin Phillips
@phillipskevin
Aug 19 2016 15:41
ok, good luck
Sunil George
@georgesunil81
Aug 19 2016 15:41
Thanks @phillipskevin
Sunil George
@georgesunil81
Aug 19 2016 16:01
@phillipskevin , so if I understand correctly, each time I do a production deployment I will need to update cache-version in the script tag?
<script src="node_modules/steal/steal.js" cache-version="14"></script>
Sunil George
@georgesunil81
Aug 19 2016 16:10
From 14 to 15 and so on incrementing it each time I do a production deployment?
Kevin Phillips
@phillipskevin
Aug 19 2016 16:15
yes
Eben
@eben-roux
Aug 19 2016 16:15
@georgesunil81 I don't quite know how the steal cache buster works but if it is simply appending the cache-version onto the urls then you may even get away with using any string. You could then even use a numeric representation of the build date and have tooling plug it into a tag of sorts:
<script src="node_modules/steal/steal.js" cache-version="{build-time}"></script>
Sunil George
@georgesunil81
Aug 19 2016 16:21
Thanks @phillipskevin . Yes @eben-roux, thanks for that input. I would love the tooling update the cache-version (make it unique) everytime I do a production deployment so that I do not have to remember incrementing the version number manually. I might forget it.
Sunil George
@georgesunil81
Aug 19 2016 16:42
@phillipskevin . i am a little confused by the statement "You'll then want to copy node_modules/steal-cache-bust/cache-bust.js to a location within your project folder. In the future this extension will be included in Steal by default.".
I am currently making a production build with steal-tools, so would I need to include the node_modules in my dist. I want to avoid putting node_modules into my dist folder if I don't have to!
Sunil George
@georgesunil81
Aug 19 2016 16:53
Let me try it out with my production dist. Will let you know if I face any issues. Thanks @phillipskevin for all your help with this.
Sunil George
@georgesunil81
Aug 19 2016 16:59
@phillipskevin A quick question - I am using "steal": "^0.16.35" and "steal-tools": "^0.16.6". Is the cache busting extension included by default in these versions, or do I have to npm install cache-bust?
Sunil George
@georgesunil81
Aug 19 2016 17:15
Maybe a stealjs question there, I will ask in that room.
Sunil George
@georgesunil81
Aug 19 2016 17:33
Can somebody direct me to any link/article that talks about can.dev.logLevel?
Do we have something like can.prod.logLevel too?