Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression b/w 2.18.0 and 2.20.20 - material-react-table seems to lose state? #1086

Closed
alex314159 opened this issue Feb 9, 2023 · 7 comments

Comments

@alex314159
Copy link

Hello,

weird bug documented here:
https://clojurians.zulipchat.com/#narrow/stream/151762-clojurescript/topic/material-react-table.20behaviour/near/325886492

with a very helpful repo from JordiBC to reproduce:
https://gitlab.com/jordibc/test-react-table

You can't collapse a line item that's been expanded before (though super collapse or expand work) in shadow-cljs 2.20.20, whereas 2.18.0 works. No errors in the console. I've played around with using my own react effects and hooks, and I have a hunch that the state is lost, or that the table is re-rendered with initial null state, as the user interacts with it. There are other similarly weird behaviours (filtering a grouped table loses the filter on expand, etc.). Very odd.

Thank you!

@thheller
Copy link
Owner

I'm not sure I understand the context here. The behavior you describe is a runtime issue, but the issue the repro describes is a compiler issue?

The repro is related to this google/closure-compiler#3639.

@alex314159
Copy link
Author

Thanks for coming back Thomas and sorry for the confusion - the issue with the accented characters in the closure compiler was sorted by me and JordiBC and is just about commenting the js file with all the accents. The real issue is that the table behaviour changed with 2.20.20 and is broken, rows can't be collapsed once they're expanded. All works well with 2.18.0.

@thheller
Copy link
Owner

And to someone that has never used react-table before and isn't familiar with what it is supposed to do: What am I supposed to do?

You can't collapse a line item that's been expanded before (though super collapse or expand work)

I can't make sense of this. What does collapse a line item mean? All I see is some table rows?

@alex314159
Copy link
Author

alex314159 commented Feb 10, 2023

chrome-capture-2023-1-10

Attaching a GIF of the weird behaviour, in shadow-cljs 2.18 i can "collapse" the expanded row, in shadow-cljs 2.20 nothing happens

@alex314159
Copy link
Author

I've narrowed it down to release 2.19.1 and later (still not working in 2.21). 2.19.0 works well. So from the changelog:

2.19.1 - 2022-06-01
[ 49fb0 ] add missing :output-feature-set options, bump default
[ 4e19b ] add and fix tests for previous commit
[ c2c18 ] fix "browser" overrides with false in package.json not working
[ b9992 ] fix REPL losing line information
[ ea6e4 ] stop watching .gitlibs for changes
[ 05f2c ] add very basic js-await macro for promise interop

Does that help? Realise it's very untractable problem given lack of apparent errors / stacktrace

@thheller
Copy link
Owner

Thanks for tracking that down. I guess 49fb078 is the cause. It bumped the default "polyfill" level from :output-feature-set :es6 to :es2020. Setting :compiler-options {:output-feature-set :es6} in the build config brings back the old behavior.

I can't say why this is a problem. Usually polyfills break stuff and don't fix things. There is far too much code in these npm packages to have any hope of tracking the issue down further. So, I'll have to leave it at that. I don't even have a guess what the actual issue could be.

@alex314159
Copy link
Author

Thank you! Can confirm all works with 2.21 with the :compiler-options setting above. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants