Skip to content

Isomorphic #25

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

Closed
wavded opened this issue Apr 23, 2015 · 6 comments
Closed

Isomorphic #25

wavded opened this issue Apr 23, 2015 · 6 comments
Assignees

Comments

@wavded
Copy link

wavded commented Apr 23, 2015

@lindell First, thanks for the hard work on this library, it appreciated!

So, I had a need for a barcode generator to:

  1. Be isomorphic
  2. Node compatible
  3. Use HTML5 Canvas and Node Canvas (if using on server side)
  4. Support multiple barcode types

Your library was the furthest along from what I found. I also scratched an itch with ES6 and webpack for bundling. The result so far is this:

https://github.com/wavded/JsBarcode/tree/isomorphic

I still have to integrate node-canvas for server side data URI generation and packaging but I tried hard to ensure none of the core logic was lost. Here is my test page against your test generator app examples:

screen shot 2015-04-23 at 15 56 56

My question is, do you have any interest in merging this in? Of course with your feedback. I will happily maintain a fork for my purposes but like the idea of having this project continue to receive bug fixes and improvements in one spot than make yet another barcode generator. There are some notable and breaking changes which are up for discussion but here is my rationale:

  1. jQuery support was removed as it didn't make sense for server side.
  2. The output is always a data-uri for consistency server and client.
  3. Instead of passing in a barcode type, they are just methods on JsBarcode, e.g. JsBarcode.CODE39(content). I'm not married to that but seemed clearer at the time.

Thoughts?

@lindell lindell self-assigned this Apr 24, 2015
@lindell
Copy link
Owner

lindell commented Apr 24, 2015

The idea of the library supporting node have been on my mind for a while. It would be great to merge your work! I will probably have to review the changes another day as I don't have the time right now but will comment on the changes then.

@wavded
Copy link
Author

wavded commented Apr 24, 2015

Sounds good @lindell, I'll will finish up the packaging and server side canvas stuff likely today. Feel free to comment whenever you have time.

@wavded
Copy link
Author

wavded commented Apr 24, 2015

@lindell I've added all the packaging and canvas support. It turns out to be most flexible to just return the canvas object for both server and client, at that point you can stream it to a file or render it to an image depending what side you are using the lib on, the readme reflects the updated api and examples.

js-barcode was taken already in npm and jsbarcode was just too similar so I went with io-barcode and published that so I can start using it. I know I've changed a ton about this project, its probably barely recognizable ;) I am pretty happy with the changes. Bower support should be trivial to re-add if desired.

@lindell
Copy link
Owner

lindell commented May 22, 2015

I'm sorry I have not taken a look at this yet. I'm in the end of my period and have my exams next week. Will check the code and then merge it after next week.

@lindell
Copy link
Owner

lindell commented Apr 14, 2016

Hello.

First I want to say sorry for completely ignoring this for so long. I did almost competently quit github for almost a year except for fixing a few bugs.

When I started updating JsBarcode again a few months back and looked at this issue I looked at your code and saw you where using ES6 syntax and thought it was no way it was still running in the browser without realizing you where using babel and webpack to compile it. I think it was well needed change and I'm changing to that now. Unfortunately it would be to much of an hassle to fork the changes but I will take a lot of inspirations.

I'm right now working on a big change with a change in the API which will make me upgrade to version 3 of the library. I will then add a contributors chapter in the readme and add you there.

@lindell
Copy link
Owner

lindell commented Apr 14, 2016

I did also add nodejs support a while back. Therefore 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