Incorrect implementation of the UMD pattern for browser clients #103

Closed
opened 2015-08-11 08:51:00 -07:00 by ColinEberhardt · 4 comments
ColinEberhardt commented 2015-08-11 08:51:00 -07:00 (Migrated from github.com)

Currently main.js and Layout.js implement the UMD pattern based on this variant:

https://github.com/umdjs/umd/blob/master/returnExports.js

However, both implementations have the following lines:

// Browser globals (root is window)
root.returnExports = factory(); 

This means that in the absence of an AMD or CommonJS environment, the module will be added as a returnExports function on the window object.

When using UMD this property name should be edited!

Currently `main.js` and `Layout.js` implement the UMD pattern based on this variant: https://github.com/umdjs/umd/blob/master/returnExports.js However, both implementations have the following lines: ``` // Browser globals (root is window) root.returnExports = factory(); ``` This means that in the absence of an AMD or CommonJS environment, the module will be added as a `returnExports` function on the window object. When using UMD this property name should be edited!
vjeux commented 2015-08-11 08:52:52 -07:00 (Migrated from github.com)

Agreed :) do it

Agreed :) do it
ColinEberhardt commented 2015-08-11 09:02:13 -07:00 (Migrated from github.com)

Agreed :) do it

Was that comment meant for #104 ?

I'd like to fix the AMD implementation with a less cut'n'paste oriented approach if possible :-)

> Agreed :) do it Was that comment meant for #104 ? I'd like to fix the AMD implementation with a less cut'n'paste oriented approach if possible :-)
vjeux commented 2015-08-11 09:12:05 -07:00 (Migrated from github.com)

Sorry, I just meant that you should do whatever you want to improve the situation :)

Sorry, I just meant that you should do whatever you want to improve the situation :)
ColinEberhardt commented 2015-08-11 09:19:51 -07:00 (Migrated from github.com)

Sorry, I just meant that you should do whatever you want to improve the situation :)

Thanks - will do :-)

> Sorry, I just meant that you should do whatever you want to improve the situation :) Thanks - will do :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#103
No description provided.