{"action":"created","issue":{"url":"https://api.github.com/repos/tbranyen/diffhtml/issues/136","repository_url":"https://api.github.com/repos/tbranyen/diffhtml","labels_url":"https://api.github.com/repos/tbranyen/diffhtml/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/tbranyen/diffhtml/issues/136/comments","events_url":"https://api.github.com/repos/tbranyen/diffhtml/issues/136/events","html_url":"https://github.com/tbranyen/diffhtml/pull/136","id":232678809,"number":136,"title":"Refactors reconcile tasks to split out tree parsing","user":{"login":"tbranyen","id":181635,"avatar_url":"https://avatars0.githubusercontent.com/u/181635?v=3","gravatar_id":"","url":"https://api.github.com/users/tbranyen","html_url":"https://github.com/tbranyen","followers_url":"https://api.github.com/users/tbranyen/followers","following_url":"https://api.github.com/users/tbranyen/following{/other_user}","gists_url":"https://api.github.com/users/tbranyen/gists{/gist_id}","starred_url":"https://api.github.com/users/tbranyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbranyen/subscriptions","organizations_url":"https://api.github.com/users/tbranyen/orgs","repos_url":"https://api.github.com/users/tbranyen/repos","events_url":"https://api.github.com/users/tbranyen/events{/privacy}","received_events_url":"https://api.github.com/users/tbranyen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-31T20:00:59Z","updated_at":"2017-06-06T03:04:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tbranyen/diffhtml/pulls/136","html_url":"https://github.com/tbranyen/diffhtml/pull/136","diff_url":"https://github.com/tbranyen/diffhtml/pull/136.diff","patch_url":"https://github.com/tbranyen/diffhtml/pull/136.patch"},"body":"I've added a diffhtml-bundling repo in this PR to demonstrate bundling/building and running the various flavors of diffHTML. Its just a start and I may remove it from the end and turn into documentation. For now its serving as a good reference to test things.\r\n\r\nInstead of writing two different versions of the reconcile-trees task, I've broken out the parsing into a separate task. I've set up default (runtime) tasks in the transaction object. The main build augments this array to inject in parsing."},"comment":{"url":"https://api.github.com/repos/tbranyen/diffhtml/issues/comments/306368764","html_url":"https://github.com/tbranyen/diffhtml/pull/136#issuecomment-306368764","issue_url":"https://api.github.com/repos/tbranyen/diffhtml/issues/136","id":306368764,"user":{"login":"mAAdhaTTah","id":4371429,"avatar_url":"https://avatars3.githubusercontent.com/u/4371429?v=3","gravatar_id":"","url":"https://api.github.com/users/mAAdhaTTah","html_url":"https://github.com/mAAdhaTTah","followers_url":"https://api.github.com/users/mAAdhaTTah/followers","following_url":"https://api.github.com/users/mAAdhaTTah/following{/other_user}","gists_url":"https://api.github.com/users/mAAdhaTTah/gists{/gist_id}","starred_url":"https://api.github.com/users/mAAdhaTTah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mAAdhaTTah/subscriptions","organizations_url":"https://api.github.com/users/mAAdhaTTah/orgs","repos_url":"https://api.github.com/users/mAAdhaTTah/repos","events_url":"https://api.github.com/users/mAAdhaTTah/events{/privacy}","received_events_url":"https://api.github.com/users/mAAdhaTTah/received_events","type":"User","site_admin":false},"created_at":"2017-06-06T03:04:27Z","updated_at":"2017-06-06T03:04:27Z","body":"This is great, now that I have a sense of what you're going for. I'm primarily coming at this from the perspective of a user consuming this module through a bundler; it sounds like you're pretty keen on making sure this works for UMD builds as well, so I think we should be able to find something that works for both cases.\r\n\r\n> To answer your question, why are we importing the lib code vs the main module? Either will work! Choose which one is best for you, but understand that tree-shaking may not necessarily work the way you'd expect by importing like that.\r\n\r\nI guess the thing I'm worried about is a consumer using webpack/browserify and possibly ending up with two different instances of the internals in their final bundle. The consumer can't pull in specific paths from `shared-internals` the same way as the modules themselves do. The modules rewrite their import process; are we expecting people to use our preset as well? If we treat `lib` as a \"public API\" of sorts, we risk consumers ending up with 2 instances of the `shared-internals` and weird, hard-to-debug errors resulting from getting different instances of the `cache` module (which happened to me in an earlier iteration).\r\n\r\nI definitely like having diffHTML absorb this complexity. I think the best way to ensure that doesn't happen is to have all the imports pointing to the package directly though. This has the added benefit of giving the consumer complete control over how everything gets resolved as well, so they can import any package from the direct export and pick and choose which bundle and apply whatever transforms are needed.\r\n\r\nOverall, I guess I'm just a little concerned there's a lot of additional complexity that could make dealing with this with a bundler more difficult. Admittedly, I don't have any proof of that, so it's entirely possible the concern is unfounded, but the multi-internals problem.\r\n\r\nI think I understand the `Symbol` solution; that seems fine, although it may be possible for a user to get nothing if the `shared-internals` are imported/accessed before `diffhtml` has added the internals to `global`.\r\n\r\nThe only other solution off the top I would suggest is actually putting the code from these internals into the `shared-internals` module directly, which then is responsible for adding whatever to `global`. Then its less of a wrapper or more actually where the code lives. It definitely makes dealing with it from a bundler perspective easier; not sure if that makes the UMD side harder though.\r\n\r\nIf you get a couple examples set up, we could probably play with all the options and see which of them work, even trying it with a few different bundlers (webpack, browserify, & rollup) to make sure they work without any specific configuration."}}
{"actor":{"display_login":"mAAdhaTTah"}}