These are chat archives for canjs/canjs

26th
Jul 2018
Stef
@sronsiek
Jul 26 2018 16:26
Is there a way to make a set of helpers avail in inheriting classes?
export default Component.extend({
  tag: 'base-component',
  helpers: {
    formatNumber: Helpers.formatNumber,
Justin Meyer
@justinbmeyer
Jul 26 2018 16:49
@sronsiek unfortunately, inheritance doesn't work directly yet. What I do is create a bunch of mixins like:
baseComponent = {
  view,
  ViewModel,
  helpers,
}
And then mix those in to what you pass to Component.extend({ .. }
var base = canReflect.deepAssign({}, baseComponent)
Component.extend( canReflect.deepAssign(base, {
  tag: "your-component"
})
There's an issue for extending: canjs/can-component#76
Gregg Roemhildt
@roemhildtg
Jul 26 2018 22:06
Hi guys. Using can-stache-loader with webpack. I'm running into a case where its trying to parse the built function:
image.png
    module: {
        rules: [{
            test: /\.stache$/,
            use: [{loader: 'can-stache-loader'}],
        },
Ivo Pinheiro
@ivospinheiro
Jul 26 2018 23:23
Hi!
Using the version of can-list@3.2.2.
I'm having this error:
TypeError: Cannot add property _cid, object is not extensible
Ivo Pinheiro
@ivospinheiro
Jul 26 2018 23:31
Is there a simple workaround for this error?