react-lazylog icon indicating copy to clipboard operation
react-lazylog copied to clipboard

3.1.x - es5 problem

Open dmarczydlo opened this issue 7 years ago • 28 comments

After update lazy-logger to version 3.1.1 (from 2.x) the problem Uncaught TypeError: e is not a function still exist.

For 2.x import { LazyLog } from 'react-lazylog/lib/LazyLog.es5'; worked but for 3.1.1 import {LazyStream, ScrollFollow} from 'react-lazylog/es5'; generating error.

dmarczydlo avatar Apr 09 '18 17:04 dmarczydlo

@dmarczydlo do you have a reduced repo I can try this out on?

eliperelman avatar Apr 09 '18 17:04 eliperelman

Hm... you can use https://github.com/dmarczydlo/docker-logger/tree/greenkeeper/react-lazylog-3.1.3 (branch created by greenkeeper) but before compile you have to update /components/docker/docker.jsx from import {LazyStream, ScrollFollow} from 'react-lazylog/lib/LazyLog.es5'; to syntax from last version

dmarczydlo avatar Apr 09 '18 17:04 dmarczydlo

@dmarczydlo there are a few other changes in the API which should be documented in the props. I tried out your repo and updated it to this and didn't see any of those ES5 errors, could you try it too?

import {LazyLog, ScrollFollow} from 'react-lazylog/es5';

// ...

<ScrollFollow startFollowing render={({follow, onScroll}) => (
  <LazyLog url={URL} follow={follow} onScroll={onScroll} />
)} />

eliperelman avatar Apr 09 '18 18:04 eliperelman

Yes but you used LazyLog instead of LazyStream. How can I use LazyLog for stream GET? And another question can I modify somehow featchOptions to send POST request?

dmarczydlo avatar Apr 09 '18 18:04 dmarczydlo

There is no longer a LazyStream, you can pass a stream prop to LazyLog:

<LazyLog stream url={URL} follow={follow} onScroll={onScroll} />

To modify fetchOptions, you should be able to specify the method:

<LazyLog
  fetchOptions={{ method: 'POST' }}

Let me know how that goes!

eliperelman avatar Apr 09 '18 19:04 eliperelman

I'm not sure that LazyLog working correct. Look at image below screenshot_20180410_073353

New rows overrides old. It looks that when some rows are to longer.

LazyLog looks like TextArea also. Can I change it to selecting row (like LazyStream worked - with colors)? (Preview expected for me version) crop

Also last row is still hidden.

fetchOptions={{ method: 'POST' }}  // working correct :)

dmarczydlo avatar Apr 10 '18 05:04 dmarczydlo

Wow, that looks really odd, almost like the style isn't being applied. Can you update to the latest version and see if that fixes anything?

eliperelman avatar Apr 10 '18 11:04 eliperelman

Hm... As I think I using the latest version

"react-lazylog": "^3.1.3",

dmarczydlo avatar Apr 10 '18 12:04 dmarczydlo

So I think that this issue existing in last version.

dmarczydlo avatar Apr 12 '18 05:04 dmarczydlo

I see the same issue with the latest version.

stephenwilliams avatar May 04 '18 14:05 stephenwilliams

If you could produce a reduced test repo, that would be really helpful.

eliperelman avatar May 04 '18 14:05 eliperelman

@eliperelman - as I saw you updated project to 2.2.0 version. What does it mean ? Did you reverse some features/props?

I want to update lazylog to last fine version but I'm confused which version is correct.

dmarczydlo avatar May 11 '18 11:05 dmarczydlo

@dmarczydlo apologies, I published #14 but didn't mean for it to be tagged as latest. I have re-tagged 3.1.3 as latest.

eliperelman avatar May 11 '18 11:05 eliperelman

So 3.1.3 should be latest also should work correctly? I mean suggested problem in here

dmarczydlo avatar May 11 '18 11:05 dmarczydlo

Right, I just don't have any repo to replicate against in order to fix it.

eliperelman avatar May 11 '18 11:05 eliperelman

Ok I will check this version on weekend. If this problem will still existing I'll try to create repo for you.

dmarczydlo avatar May 11 '18 11:05 dmarczydlo

@eliperelman Sorry it took me much longer than I expected to have time to put together an example repo.

Here you go: https://github.com/stephenwilliams/react-lazylog-issue-11

stephenwilliams avatar May 18 '18 13:05 stephenwilliams

@eliperelman quick update: v3.1.3 working correct (but only react-lazylog unfortunately react-lazylog/es5 looks like above - white page without missing styles but I using normal version)

Also last line problem still existing for v3.1.3

dmarczydlo avatar May 22 '18 16:05 dmarczydlo

OK, taking a look now.

eliperelman avatar May 22 '18 16:05 eliperelman

@dmarczydlo @stephenwilliams I didn't think you would need to do this, but could you manually import the CSS?

import 'react-lazylog/es5/index.css';

eliperelman avatar May 22 '18 17:05 eliperelman

@stephenwilliams index.css not existing in 3.1.3

dmarczydlo avatar May 22 '18 17:05 dmarczydlo

I just pushed a patch version, could you try it again?

eliperelman avatar May 22 '18 17:05 eliperelman

where is this patch? What branch? Did you push to npm or only to github somewhere?

dmarczydlo avatar May 22 '18 17:05 dmarczydlo

Sorry, it's the latest on npm, 3.1.4.

eliperelman avatar May 22 '18 17:05 eliperelman

Hm.. ok this version have index.css. I'm not sure that I understood you but if want to test solution as import index.css manually - this approach not fix last line issue for me.

react-lazylog is implemented in https://github.com/dmarczydlo/docker-logger/ master branch was updated to last version 3.1.3 few minutes ago.

dmarczydlo avatar May 22 '18 18:05 dmarczydlo

Yeah, the last line thing is not in the 3.x branch yet, but wanted to make sure the styling was showing up.

eliperelman avatar May 22 '18 18:05 eliperelman

@eliperelman Updating to 3.1.4 and adding import 'react-lazylog/es5/index.css'; fixed it for me

Thanks again for your work on this library!

stephenwilliams avatar May 22 '18 19:05 stephenwilliams

@eliperelman do you working on last line issue?

dmarczydlo avatar May 24 '18 12:05 dmarczydlo