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

bundle error - unexpected identifier #15

Open
headwinds opened this issue Feb 28, 2018 · 5 comments
Open

bundle error - unexpected identifier #15

headwinds opened this issue Feb 28, 2018 · 5 comments

Comments

@headwinds
Copy link
Collaborator

headwinds commented Feb 28, 2018

I'm trying to use this library with create-react-app which leverages webpack.

When I try to import FirebasePaginator from "firebase-paginator" I get a bundle error. When I click on the console error, it points to the index file. Its possibly related how the module is organized.

I'd like to take the firebase-paginator.js and turn it into a FirebasePaginator class (it's currently a function) and update the codebase to es6. I won't change any current functionality. Would you be open for me to make this pull request after I make the changes?

I've actually started to do this in this work-n-progress grid demo. I took firebase-paginator.js and am using it in redux to store the state. I just need to finish updating the state after a bulk delete to complete the demo. I also have a few minor paging bugs but its mostly working thanks to your awesome library!

When I googled around, I found no other libraries that matched this in terms of ease of use. I really like your API approach hiding all the complexity behind simple: next, previous, gotoPage. It was exactly what I was looking for - I learned a lot - and I'd like to give back if possible.

@deltaepsilon
Copy link
Owner

W00T!!!

Yes please!

How about I just make you a contributor?

The code itself has been stable for months, but you're right that I haven't done a good job of making this work with imports. That's on me 👎

@deltaepsilon
Copy link
Owner

Regarding turning it into a class... I'm not sure if it's necessary to get it to export.

But go ahead and convert it to a class if it's easier. It shouldn't affect the functionality. That's just a code style preference on my part, and I'm not obsessive about it.

BTW, your demo looks great 👍

@headwinds
Copy link
Collaborator Author

yes I'm fine with a function or class too - when I see a lot of nested functions and want to use new, then I usually try to refactor into a class but sometimes leaving them as functions makes perfect sense too - all depends ;-D

So this what I have in mind for the class....

FirebasePaginator

...then moving the two different approaches into strategies stealing this concept from from how PasspostJS manages all its login strats

Finite Paging Strategy

Infinite Paging Strategy

I see you also have a demo so it would be nice to test this approach with your demo too. How about I fork the project and make an es6 folder to commit this work? Then I'll try to test against your demo.

@deltaepsilon
Copy link
Owner

That looks great. It'd be awesome if it could export an ES5 compatible file to be used with script tags... but if not, I'll just use the older version off of NPM.

@Brightness85
Copy link

Brightness85 commented May 25, 2018

I found solution with import

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

3 participants