Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 01:21
    3cp commented #108
  • Aug 21 23:36
    3cp commented #1143
  • Aug 21 23:05
    3cp commented #1143
  • Aug 21 22:43

    EisenbergEffect on master

    Verify autoinject on abstract c… Merge pull request #185 from Dr… (compare)

  • Aug 21 22:43
    EisenbergEffect closed #185
  • Aug 21 21:52
    DrSammyD commented #182
  • Aug 21 21:51
    DrSammyD opened #185
  • Aug 21 18:59
    fkleuver commented #182
  • Aug 21 18:28
    shahabganji commented #1143
  • Aug 21 18:28
    shahabganji commented #1143
  • Aug 21 18:27
    shahabganji commented #1143
  • Aug 21 18:23
    shahabganji commented #1143
  • Aug 21 18:18
    shahabganji commented #1143
  • Aug 21 18:01
    shahabganji synchronize #1143
  • Aug 21 13:07
    minimoe commented #639
  • Aug 21 07:06
    DrSammyD commented #182
  • Aug 21 07:02
    DrSammyD commented #182
  • Aug 21 04:06
    EisenbergEffect closed #29
  • Aug 21 04:06

    EisenbergEffect on master

    fix(all): change package.json m… Merge pull request #386 from 3c… (compare)

  • Aug 21 04:06
    EisenbergEffect closed #386
Michael Withagen
@michaelw85
in main.ts you import app.ts
just replace it with the new name
that will become the entry point for the bundle I think
According to webpack docs: [name] The module name
Jonathan Seligsohn
@JSeligsohn
hm... thats not great, i dont want to rename the files themselves
Michael Withagen
@michaelw85
You could rename the class it exports I think that is the real module name
but that would be very confusing
also not sure if aurelia would accept that
Jonathan Seligsohn
@JSeligsohn
yea, i feel like i'm fighting against what aurelia wants
Michael Withagen
@michaelw85
I'm quite sure this return aurelia.setRoot(PLATFORM.moduleName('app')); is defining "app" as [name]
Jonathan Seligsohn
@JSeligsohn

hm... i think the entry point value is what determines it... because as i wrote above, when i changed it to

entry: {
    'admin-app': ['aurelia-bootstrapper']
  },

Then the output became vendors-admin-app.bundle.js and admin-app.bundle.js

so the issue isn't with webpack
Michael Withagen
@michaelw85
I just wanted to post that
Jonathan Seligsohn
@JSeligsohn
the issue seems to be that aurelia's cli au runscript assumes the entry point is always called app
Michael Withagen
@michaelw85
I found a stack overflow pointing out the entry points are used so I think you are right
You can configure deps for aurelia manually in webpack
Jonathan Seligsohn
@JSeligsohn
so maybe we just call this a "bug" with aurelia-cli and the default run script
how would configurign deps for aurelia help here?
Michael Withagen
@michaelw85
1 sec let me search how I manually configured aurelia to load additional deps
O right so the issue is not the loading but the entry point
Jonathan Seligsohn
@JSeligsohn
well i linked to this in my question: https://aurelia.io/docs/cli/cli-bundler/basics#bundling-and-code-splitting
you can call the scripts whatever you want, but then you don't get the default bundling/chunking and i'd have to redefine what gets split where
Michael Withagen
@michaelw85
ok so maybe renaming the script opens up a world of trouble what about redirecting on your CDN?
Jonathan Seligsohn
@JSeligsohn
at this point the easiest is just to append something like "admin" to [name], just unfortunate there isn't one place to redefine what 'name' is and for aurelia cli to respect that
Jonathan Seligsohn
@JSeligsohn
I created a bug here: aurelia/cli#1144
Kevon
@Kevon72832128_twitter
Hi everyone, I'm new to Aurelia and trying to go through the videos from EisenbergEffect posted on Aug 30, 2016. The sample files say to reference vendor-bundle.js, but my project is using webpack and generates chunks. How do I bring in the vendor javascript via the chunks. Normally, I'd just add a script tag and point it at the vendor-bundle.js, but that seems wrong to to for the chunked files. Any help would be appreciated, even a link to a "how to" would be great.
Michael Withagen
@michaelw85
@Kevon72832128_twitter you only have to install and import the lib where you need it. If it's a Aurelia plugin follow the instructions to register the plugin in the main.js/ts
Kevon
@Kevon72832128_twitter
ok, I think I see what is happening... Aurelia uses Import statements in the Main.ts to grab things it needs, then WebPack works magic to link them all in...
Kevon
@Kevon72832128_twitter
Are there any updated traning videos available anywhere? It seems that some critical things have changed since 2016
Michael Withagen
@michaelw85
@Kevon72832128_twitter yes webpack follows the imports and the config aplits based on node module names to make the vendor chunks. This is all webpack not Aurelia specific. For documentation I would follow the guides on the Aurelia website instead of following the vids
Kevon
@Kevon72832128_twitter
Thank you @michaelw85. I found one thing I was missing! This was added for me in a file I had not looked at. <script type="text/javascript" asp-src-include="~/dist/*.chunk.js" asp-append-version="true"></script>
Vaccano
@Vaccano
I am looking to add OIDC into my application. I have seen a few OIDC libraries for Aurelia, but I have not seen any that support PKCE. Does anyone know an Aurelia Library that supports PKCE?
Ischca
@Ischca
Hello,
Is there an alternative to jQuery.inview in Aurelia?
Michael Withagen
@michaelw85
@Ischca Aurelia I think you could accomplish this with the attached method in the Aurelia component lifecycle (https://aurelia.io/docs/fundamentals/cheat-sheet#creating-components):
The Component Lifecycle
Components have a well-defined lifecycle:

constructor() - The view-model's constructor is called first.
created(owningView: View, myView: View) - If the view-model implements the created callback it is invoked next. At this point in time, the view has also been created and both the view-model and the view are connected to their controller. The created callback will receive the instance of the "owningView". This is the view that the component is declared inside of. If the component itself has a view, this will be passed second.
bind(bindingContext: Object, overrideContext: Object) - Databinding is then activated on the view and view-model. If the view-model has a bind callback, it will be invoked at this time. The "binding context" to which the component is being bound will be passed first. An "override context" will be passed second. The override context contains information used to traverse the parent hierarchy and can also be used to add any contextual properties that the component wants to add. It should be noted that when the view-model has implemented the bind callback, the databinding framework will not invoke the changed handlers for the view-model's bindable properties until the "next" time those properties are updated. If you need to perform specific post-processing on your bindable properties, when implementing the bind callback, you should do so manually within the callback itself.
attached() - Next, the component is attached to the DOM (in document). If the view-model has an attached callback, it will be invoked at this time.
detached() - At some point in the future, the component may be removed from the DOM. If/When this happens, and if the view-model has a detached callback, this is when it will be invoked.
unbind() - After a component is detached, it's usually unbound. If your view-model has the unbind callback, it will be invoked during this process.
Josiah Haswell
@josiahhaswell
Man--I'm having a crazy problem with aurelia-bootstrap--it's just not loading anything
Josiah Haswell
@josiahhaswell
err. Aurelia-bootstrapper
Josiah Haswell
@josiahhaswell
Eh
Nm. Somehow some bundles got added to my JSPM config
Josiah Haswell
@josiahhaswell
I guess the bundles field in JSPM 0.17's jspm.config.js jacks up aurelia-bootstrapper?
Ah. So that's what the "inject" option does in bundle-config
whack
Josiah Haswell
@josiahhaswell
Bleh. I guess that works in jspm 0.16 but not 17
bigopon
@bigopon
@josiahhaswell what fun are you having there?
Josiah Haswell
@josiahhaswell
Idk. I'm learning that I don't fully understand bundling. All of those things I said before were wrong
I mean, mostly it's working now
Now the only thing that's not working in this configure function is the setRoot, and it's just dying silently

export async function configure(application : Aurelia) {
  console.log("Got one");
  application.use
             .plugin('aire')
             .developmentLogging('debug')
             .standardConfiguration();
  console.log("Got 2");
  await application.start();
  console.log("Got 3");
  await application.setRoot('docs/application');
  console.log("Got 4");
}
bigopon
@bigopon
@josiahhaswell it should be working fine, from the look of the above block
if it dies silently, then it's must be something hidding the debug message
devJ0n
@devJ0n
import { ViewEngineHooks, View } from 'aurelia-framework';
// import { viewEngineHooks } from 'aurelia-binding';
import { MediaType } from './mediaType.ts';

// By convention, Aurelia will look for any classes of the form 
// {name}ViewEngineHooks and load them as a ViewEngineHooks resource. We can
// use the @viewEngineHooks decorator instead if we want to give the class a
// different name.
export class MediaTypeViewEngineHooks implements ViewEngineHooks {

  // The `beforeBind` method is called before the ViewModel is bound to
  // the view. We want to expose the enum to the binding context so that
  // when Aurelia binds the data it will find our MediaType enum.
  beforeBind(view: View) {

    // We add the enum to the override context. This will expose the enum
    // to the view without interfering with any properties on the
    // bindingContext itself.
    view.overrideContext['MediaType'] = MediaType;

    // Since TypeScript enums are not iterable, we need to do a bit of extra
    // legwork if we plan on iterating over the enum keys.
    view.overrideContext['MediaTypes'] = 
      Object.keys(MediaType)
        .filter((key) => typeof MediaType[key] === 'number');
  }
}
How do I solve this Typescript compile error? on row " view.overrideContext['MediaType'] = MediaType;"
Element implicitly has an 'any' type because expression of type '"MediaType"' can't be used to index type 'Object'.
  Property 'MediaType' does not exist on type 'Object'.ts(7053)
Michael Withagen
@michaelw85
@devJ0n Looking at the error I would think view.overrideContext['MediaType'] does not exist