by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 19 23:31
    dependabot[bot] labeled #92
  • Jul 19 23:31
    dependabot[bot] opened #92
  • Jul 19 23:31

    dependabot[bot] on npm_and_yarn

    Bump lodash from 4.17.15 to 4.1… (compare)

  • May 07 23:31

    ArthurClemens on 1.5.6

    1.5.6 (compare)

  • May 07 23:31

    ArthurClemens on 1.5.6

    (compare)

  • May 07 23:29

    ArthurClemens on 1.5.5

    Update publish.mjs (compare)

  • May 07 23:23

    ArthurClemens on 1.5.5

    Update publish.mjs (compare)

  • May 07 23:08

    ArthurClemens on 1.5.5

    Bump to 1.5.5 Merge branch '1.5.5-2' into 1.5… (compare)

  • May 07 23:05

    ArthurClemens on 1.5.5

    1.5.5 Update publish.mjs (compare)

  • May 07 22:58

    ArthurClemens on 1.5.5

    (compare)

  • May 06 15:25
    modir commented #91
  • May 06 15:21
    modir closed #91
  • May 06 15:21
    modir commented #91
  • May 06 13:36
    ArthurClemens commented #91
  • May 06 13:13
    modir commented #91
  • May 06 12:57
    ArthurClemens commented #91
  • May 06 00:24
    modir opened #91
  • Apr 15 13:27
    ArthurClemens closed #90
  • Mar 24 00:07
    ArthurClemens commented #90
  • Mar 23 23:57

    ArthurClemens on master

    Update changes.md (compare)

cruzmiraback
@cruzmiraback
Gotcha
cruzmiraback
@cruzmiraback
I think I found an issue. If you have a TextField with an onblur event attached it will interfere with the component toggling off the pe-textfield--focused class. Flems
Arthur Clemens
@ArthurClemens
I found the issue in the code. Will work on this this weekend.
Arthur Clemens
@ArthurClemens
@cruzmiraback Fixed in 1.7.2
cruzmiraback
@cruzmiraback
@ArthurClemens Confirmed fixed, cheers! :+1:
Mir Nawaz
@mir-nawaz
Hello Guys . need help for below error.
for
"mithril": "^2.0.4",
"polythene-mithril": "^1.7.4"
Error
cyano-mithril.js:1 TypeError: Cannot read property 'focus' of undefined
at polythene-core-search.js:1
at e._Search (polythene-core-search.js:1)
at Object.view (cyano-mithril.js:1)
at Function.callHook (render.js:30)
at updateComponent (render.js:482)
at updateNode (render.js:419)
at updateNodes (render.js:302)
at updateElement (render.js:477)
at updateNode (render.js:416)
at updateNodes (render.js:302)
Arthur Clemens
@ArthurClemens
Could you create a flems.io to reproduce the issue?
or codesandbox
Cory Mawhorter
@cmawhorter
hey @MonolithicMonk i'm seeing the same error, but with a DialogPane. i just recently bumped mithril to 1.1.7 and i'm seeing the issue. unfortunately upgrading to v2 would be significant for me.
everything renders correctly but when attempting to switch between tabs it causes the error
bah. now i'm noticing other errors that weren't problems before too. i'm going to revert to an older mithril and see if that does anything
Cory Mawhorter
@cmawhorter
oh. and the error is TypeError: Cannot read property 'current' of undefinedin useEffect. sometimes i can switch between the tabs more than once too
Cory Mawhorter
@cmawhorter
reverting mithril didn't fix the issue. i also tried reverting polythene with no luck but i noticed when installing polythene 1.5.4 it complained of a mithril-hooks unmet peer dep for mithril > 2. could mithril-hooks be the source of the problem?
Cory Mawhorter
@cmawhorter
i found #81 which seems to be a similar, but different problem. in my case -- what i'm guessing is happening -- is that even though i'm requesting 1.5.4 polythene-mithril its always installing the latest deps (e.g. mithril-hooks) which are more closely targeting mithril v2
Arthur Clemens
@ArthurClemens
I just tested mithril 1.1.7 on a couple of flems demos, and they work as expected. I’m not sure why I’ve set the peerDependency to 2.0.4.
There is also the possibility that your project is loading multiple versions of Mithril. I’ve been bitten by that in the past, so I now automatically use these lines in my webpack configuration: https://github.com/ArthurClemens/polythene/blob/master/scripts/bundling/webpack.config.js#L25-L26
What component specifically is causing problems?
Cory Mawhorter
@cmawhorter
the problem is that polythene deps use "^x.x.x" instead of a fixed version. for example, i've installed polythene-mithril@1.5.4 specifically, but its still installing polythene-css-* at 1.7.4
i have cyano-mithil in my package-lock file even though at the time 1.5.4 was published that wasn't a thing
flems will never see this problem because its related to npm/node and deps
Arthur Clemens
@ArthurClemens
Yes, the ^ was a mistake. That got fixed in 1.6.5
Cory Mawhorter
@cmawhorter

ok, just reduced it enough for a repro:

  1. create a new empty package.json
  2. npm i polythene-css@1.5.4 polythene-mithril@1.5.4 polythene-utilities@1.5.4
  3. open package-lock and examine what's installed.

"polythene-mithril-base" is 1.5.4 but "polythene-mithril-button" and all the others are 1.7.4

Arthur Clemens
@ArthurClemens
What is specific to version 1.5.4 that you need?
Cory Mawhorter
@cmawhorter
nothing in 1.5.4 specifically. i just upgrade to 1.7.4 and noticed some of my stuff broke and was trying to fix it. i'm seeing the same problem that was mentioned a while back here in chat
and i was trying to revert to last known working and ran into that other problem. i'll try 1.6.5 and see if that resolves it
Cory Mawhorter
@cmawhorter
image.png
^== damn. no luck. i'm still seeing issues with scrollElRef being undefined
Arthur Clemens
@ArthurClemens
could you provide some real code?
Cory Mawhorter
@cmawhorter

sure thing -- this seems to be the root cause here:

    m(Tabs, {
      tabs: [
        { _id: 'sections', label: 'Sections' },
        { _id: 'settings', label: 'Theme' },
      ],
      onChange({ options }) {
        vnode.state.selectedSidebarTab = options._id;
        // when changing between tabs, reset tabs to their home state
        clearSettingsBeingEdited(vnode);
      },
    })

if i remove the onChange the problem goes away

i tried wrapping the body of the handler in a setTimeout and that doesn't work. i was just about to add a longer delay
Arthur Clemens
@ArthurClemens
Which mithril version are you using here?
Cory Mawhorter
@cmawhorter
1.1.7. and adding a 1s delay to that handler body firing (with a redraw added) makes the error go away
i guarantee its my code causing the problem. this thing was thrown together
Arthur Clemens
@ArthurClemens
You you try to change https://codesandbox.io/s/polythene-for-mithril-tabs-issue-with-mithril-1x-owvjo to your setup? (as this is working fine)
Cory Mawhorter
@cmawhorter
thanks, i'll take a look at that and see if i can get you any useful info. just in case it helps heres the full ugly function: https://gist.github.com/cmawhorter/0d4a8d73d607d2f93de73588ded6b502
something i neglected to mention is i'm using drawers with a key. not sure if that's part of the issue. i'll give your link a shot and find out
Cory Mawhorter
@cmawhorter
oooook. i think i have a repro. it seems to only happen when the tab body contains a lot of content
i tried adding an onbeforeremove to simulate a lot of teardown but that did nothing. it was only when i created a ton of nodes in a tab body that i could get it to happen
to get it to happen just switch between the tabs back and force rapidly and it'll eventually throw
no idea if drawer is involved
hmmm. though i'm not sure if that's my problem or just a different problem. my link still has the onbeforeremove delay and removing that makes that error go away. dfslkjfdklsjfklerjklwjlka
Cory Mawhorter
@cmawhorter
FWIW i'm giving up and wrapping the handler in a setTimeout and a delay
Arthur Clemens
@ArthurClemens
The tabs do work fine with Mithril 2.x
Cory Mawhorter
@cmawhorter
yeah, but mithril v2 has breaking changes and my app is large and i'm dev and QA. IMO you should unpublish anything > 1.5.4 and republish as v2 since anyone upgrading from 1.5 will experience breaking changes
or remove support for mithril v1
or maybe you could publish v1.5.5 w/deps fixed :heart: ;]
Arthur Clemens
@ArthurClemens
I’ll look into it
Cory Mawhorter
@cmawhorter
i tried to put together a PR but i'm having problems getting the dev env running. thanks for all the help now and in the past Arthur!
Arthur Clemens
@ArthurClemens
@cmawhorter You can now use fixed-version-1.5.6