-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
added optional window to avoid requiring 'jsdom' everytime #43
Conversation
# Create a DOM if `window` doesn't exist (i.e. when running in node). | ||
@win = window ? null | ||
# Use the options.window if one is passed, issue #42 | ||
# If not, create a DOM if `window` doesn't exist (i.e. when running in node). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rephrase this to not include the issue reference? For example:
# Use the `window` option when specified or create a DOM if `window` doesn't exist (i.e. when running in node).
Although this does seem a lot like supporting a workaround instead of implementing a fix, I'm not sure how much this is a problem. I doubt the majority of use-cases will encounter the memory leak mentioned in #42 but I'm happy to accommodate you advanced users 😉 I would have preferred to only call If you could make the changes I've suggested, I'll merge it in and update the README and maybe get a minor release out. |
you were right, the bottleneck still in Thanks |
otherwise coffee compiler will generate the var within the constructor's scope, so it would still be required every time.
@neocotic any plans to merge that in? |
Yes, sorry. Thanks for the reminder 😄 |
don't mean to nag, ✌️ just another friendly reminder. |
@akhoury Don't worry. I've not forgotten. Honestly, I'm currently looking at alternatives to jsdom since it's possibly too much overhead (especially for Windows users). Please stay with me and, if the investigation takes too long, I'll simply merge this in for the time being, at least. Thanks for your patience. |
I haven't forgotten 😄 Will probably merge this in this weekend (have set a reminder). |
@neocotic getting this into html-md would be awesome -- I'm trying to use html-md in a loop during a data migration here at work, and am running into this leak. |
@toddself - I have full confidence in @neocotic to address this corner-case issue one way or another, but till then, I was able to get away using this temporary close-enough-fork: (see why it's not a regular fork) package.json:
then follow the example in the initial post of this thread for an example on how to use it. IMPORTANT:as I state in the readme, I WILL delete the repo once this issue is resolved. |
@akhoury I saw that :) and resolved with an However, still getting a Heap::ReserveSpace Allocation failure. :(. I'm going to profile this and see if I can't find some other heap issues. |
can you provide an example for me to replicate the heap issue? I'd love to take a look. |
Working on reducing down my example to something manageable :) |
^ fair enough - still waiting on @toddself's reduced example to reproduce the heap issue. |
@toddself, any update on the problems you were experiencing? |
Sorry for taking so so very long to address this. I finally got around to doing the massive rewrite of this library that I wanted to. It's been renamed Europa and it's totally changed. One key change that fixes this issue is that I've split up the project into several modules. I also bumped the dependency for Most of all, if you want to install for browser or Node.js, now all you need is npm: # For browser:
$ npm install --save europa
# For Node.js:
$ npm install --save node-europa Both install quickly and have no confusing dependencies or external dependencies. I'm closing this PR now as it's no longer valid. If you still use Sorry again for the massive delay. |
I added an optional
options.window
so I can nowrequire('jsdom')
andcreateWindow()
before handkinda like that.
I built and successfully tested locally, but didn't commit build files per your contribution guide
Thanks, great module btw.
closes issue#42