Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:20
    greenkeeper[bot] labeled #5391
  • 22:20
    greenkeeper[bot] opened #5391
  • 22:20

    greenkeeper[bot] on can-observable-mixin-1.0.3

    fix(package): update can-observ… (compare)

  • 19:08
    cherifGsoul labeled #5390
  • 19:07
    cherifGsoul opened #5390
  • 18:45
    greenkeeper[bot] labeled #5389
  • 18:45
    greenkeeper[bot] opened #5389
  • 18:45

    greenkeeper[bot] on can-observable-bindings-1.3.0

    fix(package): update can-observ… (compare)

  • 18:29

    matthewp on master

    Update dist for release (compare)

  • 18:29

    matthewp on v6.1.3

    Update dist for release 6.1.3 (compare)

  • 17:59

    matthewp on can-observable-array-1.0.2

    (compare)

  • 17:59

    matthewp on master

    fix(package): update can-observ… Merge pull request #5388 from c… (compare)

  • 17:59
    matthewp closed #5388
  • 16:46
    greenkeeper[bot] labeled #5388
  • 16:46
    greenkeeper[bot] opened #5388
  • 16:46

    greenkeeper[bot] on can-observable-array-1.0.2

    fix(package): update can-observ… (compare)

  • 12:45
    greenkeeper[bot] labeled #5387
  • 12:45
    greenkeeper[bot] opened #5387
  • 12:45

    greenkeeper[bot] on can-stache-element-1.0.2

    fix(package): update can-stache… (compare)

  • 09:49
    chasenlehara edited #5384
Jim O'Harra-Sutton
@Psykoral
yep, but should it be something other than AppState?
export const AppState = new AppStateClass();
export default AppState;
Brad Momberger
@bmomberger-bitovi
That should work fine.
Though you could also try import {AppState} from '~/_app/js/state'; just for shits and giggles.
(that syntax imports the named export instead of the default)
The one other possibility is that these files have a circular dependency. Steal resolves that by initially letting circular deps be undefined, then letting the scripts create their exports.
Which means you can still use imports from a circular dependency, but not synchonously.
Jim O'Harra-Sutton
@Psykoral
ERROR: Failed promise: TypeError: Error evaluating myapp@2.0.0#_app/js/state
Error evaluating myapp@2.0.0#models/session
AppState is undefined
that's with import {AppState} from '~/_app/js/state';
Brad Momberger
@bmomberger-bitovi
Is it salient that in footer.js you were importing from "~/state"?
Jim O'Harra-Sutton
@Psykoral
ha, wow
I mean footer.js just had import AppState from "~/_app/js/state"; in it but was never being used. Didn't think that would be undefined, but I commented that out and no errors now
Jim O'Harra-Sutton
@Psykoral
OK so progress... errors are all gone
I login, AppState.authToken get updated, but the getters aren't firing
Brad Momberger
@bmomberger-bitovi
Can you get the view model from your footer or any component that has a dependent getter and see what its value is?
Jim O'Harra-Sutton
@Psykoral
Oh I think I see what it was, I was setting the this.sessionState = false;which was changed to the getter instead
Brad Momberger
@bmomberger-bitovi
BTW getters can take set values as input as well.
Give them an argument like such:
foo: {
  get: function(lastSetValue) {
      return typeof lastSetValue !== "undefined" ? lastSetValue : this.someOtherProperty;
 }
}
So in this case, setting foo = "bar" will trigger an update. That doesn't happen when get() has zero arguments.
Jim O'Harra-Sutton
@Psykoral
sessionState: {
        get (lastSetValue) {
            return typeof lastSetValue !== 'undefined' ? lastSetValue : (AppState.authToken !== null);
        }
    },
logout () {
        //this.sessionPromise = AppState.session.destroy();
        AppState.authToken = null;
        this.debug.log('logout: AppState.authToken should be null', null);
        this.debug.log('logout: this.sessionState should be false', this.sessionState);
    }

me clicks the logout button ...

Login: logout: AppState.authToken should be null null debug.js:111:3
Login: logout: this.sessionState should be false true

Brad Momberger
@bmomberger-bitovi
Did you mean this.debug.log('logout: AppState.authToken should be null', AppState.authToken);?
Jim O'Harra-Sutton
@Psykoral
so AppState.authToken is successfully changing to null but then the this.sessionState isn't changing with the change of AppState.authToken
Brad Momberger
@bmomberger-bitovi
Are you setting sessionState somewhere, though?
If you are using the lastSetValue form for the getter, you want to make sure you set it to undefined before reading off its value
I'm more than an hour overdue for bed, so anything else you run into will have to be dealt with later.
Jim O'Harra-Sutton
@Psykoral
yeah no worries man, don't stay up late on my account. Thanks so much for all your help though!
Jim O'Harra-Sutton
@Psykoral
:cD
Morgan Heimbeck
@Xitstrategies
Hey, if someone could look at canjs/can-ajax#13 that would be great!
Morgan Heimbeck
@Xitstrategies
Also, I am having issues with the isSimpleCors including the POST method, because I want it to be a json content, but because POST is a simple CORS type, can-ajax is using can-param to parse the data, but can-param is not parsing all data, dates in particular. Has anyone else run in to this? I have a fork of can-ajax and removed POST from the isSimpleCors check and it is working the way I want it. simple cors does not require a preflight check but that doesn't mean you have to avoid it with post. Thoughts?
Brad Momberger
@bmomberger-bitovi
@Xitstrategies can-ajax can't have can-util as a dependency
That's a cyclic dep because can-util is already depending on can-ajax
But you did help find a bug in my cycle detection script, so thanks for that!
Brad Momberger
@bmomberger-bitovi
My recommendation is to import can-reflect and use canReflect.assignDeep() instead. I'll put that in a review on the PR
Chasen Le Hara
@chasenlehara
@Xitstrategies It’s been a while since I’ve worked with CORS stuff, but I think I am following along with what you’re saying.
It seems like the logic in that section of the code might be wrong, but I’m not 100% sure how.
Should isSimpleCors be false if isJsonContentType is true?
Morgan Heimbeck
@Xitstrategies
@bmomberger-bitovi Thanks for the message, I will get on that.
Morgan Heimbeck
@Xitstrategies
@chasenlehara I was thinking that the isSimpleCors assignment needs to be moved up to determine if the content Type was explicitly set to json, which is not a supported contentType for simpleCors. But by moving up there, then the logic from L186-L193 can stay the same and can be turned in to a simpleCors without needing preflight. Because isJsonContentType is defaulted up on L117.
Chasen Le Hara
@chasenlehara
Ok, so isSimpleCors should also check for isJsonContentType, something like var isSimpleCors = o.crossDomain && ! isJsonContentType && ['GET', 'POST', 'HEAD'].indexOf(type) !== -1;
Morgan Heimbeck
@Xitstrategies
@bmomberger-bitovi alright, took some mistakes to get the right thing, but should be good to go now.
Morgan Heimbeck
@Xitstrategies
@chasenlehara yes
Chasen Le Hara
@chasenlehara
We’ll be streaming our contributors meeting in 10-15 minutes! https://www.youtube.com/watch?v=uWpuS0qnbgM
pavankmv
@pavankmv
Hi,
Using can-connect getData method, is there any way to pass a parameter in the URL, instead of query parameters?
Frank Lemanschik
@frank-dspeed
?
what do you mean more exactly