Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 11 12:59
    865881900 commented #192
  • Sep 11 12:47
    865881900 commented #192
  • Sep 04 06:16
    jvanbruegge commented #982
  • Sep 04 06:16

    jvanbruegge on master

    chore(tools): add npm run examp… (compare)

  • Sep 04 06:16
    jvanbruegge closed #982
  • Sep 04 04:36
    shfshanyue commented #982
  • Sep 04 03:25
    shfshanyue commented #982
  • Sep 04 03:17
    shfshanyue synchronize #982
  • Sep 03 14:12
    jvanbruegge commented #982
  • Sep 03 14:10
    jvanbruegge commented #982
  • Sep 03 13:47
    shfshanyue commented #982
  • Sep 03 13:35

    jvanbruegge on v3.1.0

    (compare)

  • Sep 03 13:35

    jvanbruegge on master

    chore(release): v3.1.0 (compare)

  • Sep 03 13:22
    shfshanyue synchronize #982
  • Sep 03 08:09
    jvanbruegge commented #982
  • Sep 03 08:03
    jvanbruegge closed #981
  • Sep 03 08:03
    jvanbruegge commented #981
  • Sep 03 08:03

    jvanbruegge on master

    chore(test): fix tests for stri… (compare)

  • Sep 03 08:03

    jvanbruegge on fix-lint

    (compare)

  • Sep 03 08:03
    jvanbruegge closed #983
Sebastian Boutin Blomfield
@sebovzeoueb
I did npm i webpack webpack-cli snabbdom in my test project
and then I have a script in the package that does webpack -w
all this was working just fine with the CommonJS snabbdom
and so far my main.js just has import {init} from 'snabbdom/init'
like the top line of the example
and webpack just seems unable to find the whole snabbdom module
Sebastian Boutin Blomfield
@sebovzeoueb
and it's not just webpack, vscode isn't generating any suggestions either
it's like it just didn't install at all
Sebastian Boutin Blomfield
@sebovzeoueb
well, it suggests snabbdom, but then only the build and src directories
I don't see any of the exports
Sebastian Boutin Blomfield
@sebovzeoueb
huh, if I'm understanding the issue correctly, stable version webpack doesn't support the package.json exports yet
Sebastian Boutin Blomfield
@sebovzeoueb
OK, I can confirm that it's the problem
you have to use webpack@next otherwise snabbdom's exports don't work
Géraud Henrion
@fuunnx
I can confirm I also have to import under the snabbdom/build folder :
import { eventListenersModule } from "snabbdom/build/package/modules/eventlisteners";
Sebastian Boutin Blomfield
@sebovzeoueb
yeah, I guess that's the other way to do it
Bruce Stockwell
@stockwellb
how do I get to things like :focus for css instead of using events? h("input", { style: { ...baseStyle, ...style }, props: { ...rest }, on: { focus: (e) => (e.target.style.border = "1px solid black") }, },[children] )
Patrick Kelly
@patomation
good question @stockwellb, I'm going to try this out and get back to you.
Patrick Kelly
@patomation
Hmm, maybe someone else can chime in that has more experience, but you may have to use a library like styled-jss or radium to handle pseudo selectors
Patrick Kelly
@patomation

@fuunnx @sebovzeoueb another solution besides using webpack@next is to use an alias in webpack.config

module.exports = {
  ...
  resolve: {
    alias: {
      snabbdom: path.resolve(__dirname, 'node_modules', 'snabbdom', 'build', 'package')
    }
  }
}

Then for TypeScript in the tsconfig

{
    ...
    "paths": {
      "snabbdom/*": ["node_modules/snabbdom/build/package/*"]
    }
  }
}
Géraud Henrion
@fuunnx
thanks 👍
Bruce Stockwell
@stockwellb
@patomation thanks for looking into that for me.
Patrick Kelly
@patomation
Has anyone been able to get testing working with their apps? I'm having a hell of a time. I would use mocha, jest or ava which ever one works.
Patrick Kelly
@patomation
Is Snabbdom not participating in Hacktoberfest?
Sebastian Boutin Blomfield
@sebovzeoueb
did 2.0 break event handler arrays?
I'm making a simple test project to show off snabbdom and stuff that I used to do doesn't work anymore :D
  h('div.button', {on: {click: e => send({type: 'increment'})}}, 'Increment'),
  h('div.button', {on: {click: [send, {type: 'increment'}]}}, 'Increment'),
top one works as intended, bottom one the mouse event is being sent to the send function instead of that object
the documentation suggests that the bottom one should still work
is this a bug or has 2.0 changed the way this feature works?
Sebastian Boutin Blomfield
@sebovzeoueb
also is there anywhere that the changelogs are published between versions?
would be nice to know if there's a good reason to upgrade
I'm currently on 1 with current projects
Mike Reinstein
@mreinstein
@patomation have you tried browser-env ? it's a pretty reasonable shim for getting some window-like globals into node processes. I've used it for testing other dom related stuff: https://www.npmjs.com/package/browser-env
Sebastian Boutin Blomfield
@sebovzeoueb
of course it's in CHANGELOG.md, silly me :D
@mreinstein is my issue above what's referred to as loaded/carrying eventlisteners?
or did I find a bug?
Mike Reinstein
@mreinstein
@sebovzeoueb 2.0 removed support for the feature you're referring to. see snabbdom/snabbdom#802
Sebastian Boutin Blomfield
@sebovzeoueb
oh cool, the readme should be updated to reflect this
Mike Reinstein
@mreinstein
it's in the changelog, that is the appropriate place for documenting changes
Sebastian Boutin Blomfield
@sebovzeoueb
Yes, but the Readme has a whole section explaining this feature that is no longer a feature
a bit confusing to have it on the project's landing page if it's no longer supported
Mike Reinstein
@mreinstein
if it's on the landing page, my guess would be that it's gotten enough questions around it that someone thought it wise to put it directly on the readme in an effort to reduce the github issue noise. An exceptional situation. ;) I think probably it could be removed from the readme at some point, as 2.0 release date slides further into history
Sebastian Boutin Blomfield
@sebovzeoueb
No, I mean the opposite of that, the readme talks about this feature including a code example, leading you to believe that you can use the old array handler, when in fact you can't do that anymore.
Had that section been deleted I would have noticed that it was no longer listed as a feature, which it currently is quite prominently
Isaac Shapira
@fresheyeball_gitlab
hey there
how the heck do I build this thing?
npm run compile results in javascript files that do not work in the browser as is
that the closetest I found!
Dave Smith
@davesmith00000
Hello, I'm using a framework that uses snabbdom under the hood and I'm having a problem where HTML entities like & and   are being renderer as text (i.e. you literally see the characters on the screen, not the symbol) - anyone know what might be going on there? (There's a good chance this isn't snabbdom related, I'm out of practice... :-) )