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

Use UMD for module definitions #6

Open
lfryc opened this issue Oct 2, 2013 · 4 comments
Open

Use UMD for module definitions #6

lfryc opened this issue Oct 2, 2013 · 4 comments
Assignees

Comments

@lfryc
Copy link

lfryc commented Oct 2, 2013

I would like to use dom-compare together with RequireJS (AMD) module loader.

Since dom-compare currently uses Node module definitions (CommonJS-like),

I suggest to use UMD as an universal module loader pattern,
particularly, we could leverage this adapter:
https://github.com/umdjs/umd/blob/master/commonjsAdapter.js

I have already re-factored dom-compare to use just AMD (https://github.com/lfryc/dom-compare/commits/requirejs), but I can open new pull request with refactoring to UMD.

@Olegas
Copy link
Owner

Olegas commented Oct 6, 2013

@lfryc Sorry, but I don't have any experience with UMD, so, pull-request will be great.
Do you want to use dom-compare in the browser?

@lfryc
Copy link
Author

lfryc commented Oct 7, 2013

That's right, I would like to..

I face few other problems - the implementation is partially right, but browser implement DOM interface slighly different, thus there will need to be more fixes than initially expected.

@Olegas
Copy link
Owner

Olegas commented Oct 7, 2013

What if I "compile" a single client-side file to use in browser? It will be a part of library.

Also, please let me know about fixes you need to work correctly in browser. May be fill an issue?

@lfryc
Copy link
Author

lfryc commented Oct 22, 2013

Hey Oleg, thanks for your interest,

we will release RichWidgets 0.1 with a fork and later in the process I will
make sure to propagate those changes here - my progress is tracker here:
richwidgets/richwidgets#49

I also found some issues you already fixed (e.g. whitespace trimming).

Ad UMD)

An advantage of UMD syntax is that you don't need to care about where a
code runs,
since all common module loaders are supported (such as AMD and CommonJS).

You just need to use universal module definitions specified by UMD project
and that's it.

But I haven't use UMD initially in my fork, I just used plain RequireJS - I
can rewrite it potentially.

Ad TESTING)

Otherwise testing of dom-compare for browser support will be hard-nut. It
would likely require extended build structure which supports test runners
such as Karma.

Since tests are apparently written in Jasmine, Karma could actually handle
them quite easily (we use Karma with Jasmine in RichWidgets).
This way even tests could be used on both, Node and browser. ;-)

On Mon, Oct 7, 2013 at 5:30 PM, Oleg Elifantiev [email protected]:

What if I "compile" a single client-side file to use in browser? It will
be a part of library.

Also, please let me know about fixes you need to work correctly in
browser. May be fill an issue?


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-25818382
.

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