Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Alternative production loader to almond
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Christoph Dorn  
View profile  
 More options Jan 4 2012, 7:51 pm
From: Christoph Dorn <christoph...@christophdorn.com>
Date: Wed, 04 Jan 2012 16:51:38 -0800
Local: Wed, Jan 4 2012 7:51 pm
Subject: Alternative production loader to almond
Hi all,

I have published a new module loader for production use:

https://github.com/sourcemint/loader-js

It could be a good replacement for almond. It does not support loader
plugins (and never will) but has some other nice features that almond
does not.

If anyone is interested in using the Sourcemint loader instead of almond
for production use I would be happy to answer questions.

It should be relatively trivial to modify the RequireJS build tool to
export bundles in the proper format for the loader and shim modules to
convert RequireJS idioms.

Looking forward to feedback!

Christoph


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Burke  
View profile  
 More options Jan 8 2012, 8:26 pm
From: James Burke <jrbu...@gmail.com>
Date: Sun, 8 Jan 2012 17:26:57 -0800
Local: Sun, Jan 8 2012 8:26 pm
Subject: Re: [requirejs] Alternative production loader to almond
On Wed, Jan 4, 2012 at 4:51 PM, Christoph Dorn

Since it does not support the AMD syntax out of the box, I'm not sure
of the benefits. It seems like the sandboxing benefits could be
achieved by just running two different almond-based builds and having
them wrapped via the r.js wrap config option so they do not see each
other.

I think it is great to have different small loaders that specialize on
specific tasks, even ones that do not support loader plugins. However,
I did not follow your points about not explicitly supporting plugins:

> * They are present and can be executed when generating bundles.

I think the plugin needs to be present anyway since it is needed for
runtime? I'm not sure what this point is about. Maybe expanding it
would help.

> * Module/resource source code is bundled in a specific format potentially leading to duplicate source code in bundles.

I also do not follow this point either, expanding on how there could
be a duplicate source in a build would be useful to know.

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christoph Dorn  
View profile  
 More options Jan 9 2012, 2:50 pm
From: Christoph Dorn <christoph...@christophdorn.com>
Date: Mon, 09 Jan 2012 11:50:31 -0800
Local: Mon, Jan 9 2012 2:50 pm
Subject: Re: [requirejs] Alternative production loader to almond

The benefit is having a loader that isolates different apps/widgets in
the browser without having to configure anything at build time and
writing canonical IDs into the bundle files. It completely separates
building from loading. While the loader does not support AMD syntax out
of the box it should be trivial to add as an extension. I would be happy
to explore this if there is interest.

> I think it is great to have different small loaders that specialize on
> specific tasks, even ones that do not support loader plugins. However,
> I did not follow your points about not explicitly supporting plugins:

>> >  * They are present and can be executed when generating bundles.
> I think the plugin needs to be present anyway since it is needed for
> runtime? I'm not sure what this point is about. Maybe expanding it
> would help.

Scrap that explanation. It was late :) Let me try and elaborate and I
will update the text when this thread is done.

To me there are two types of plugins:

   1) Plugins that modify module source before module is loaded
   2) Plugins that modify loader to achieve specific behavior

While RequireJS seems to combine these two types into the same interface
I believe they should be separated and handled distinctly.

Plugins that facilitate (1) should be declared by the exporting package
(provider) not the module requiring the modified module (consumer). By
having the provider export a consistent modified module all consumers
will always get the same module and the modified module may be written
into the bundle file without needing to include the plugin. The plugin
should be an AMD/CJS module that is invoked at build time to "compile"
the module source once. I don't think you want the overhead of the
plugin on the client side in most cases. For this approach to work you
need either:

   * A development loader that understands packages and package
descriptors and is able to load (without server helper of build step)
type (1) plugins into the browser (and these plugins must run in the
browser). A browser loader that could do this is BravoJS with the
package mappings plugin [1][2].
   * A server helper or build step that invokes the plugins and only
makes the result available eliminating the extra step from the client.

Plugins that facilitate (2) should be loaded along with the application
and then be injected into a sandbox to modify the behavior of the
sandbox's require which then loads the application code. These plugins
should be pure JS AMD/CJS modules.

In my experience, the above approach simplifies the loader logic and
makes the build step more robust.

>> >  * Module/resource source code is bundled in a specific format potentially leading to duplicate source code in bundles.
> I also do not follow this point either, expanding on how there could
> be a duplicate source in a build would be useful to know.

I take this back. It applies only to cases where an application requires
the raw module source and the modified module source (without wanting
the type (1) plugin on the client). I don't see a way around this.

Christoph

[1] -
https://github.com/pinf/loader-js/tree/master/lib/pinf-loader-js/bravojs
[2] -
https://github.com/pinf/loader-js/tree/master/lib/pinf-loader-js/brav...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christoph Dorn  
View profile  
 More options Jan 14 2012, 2:35 am
From: Christoph Dorn <christoph...@christophdorn.com>
Date: Fri, 13 Jan 2012 23:35:13 -0800
Local: Sat, Jan 14 2012 2:35 am
Subject: Re: [requirejs] Alternative production loader to almond

Christoph Dorn wrote:
>> Since it does not support the AMD syntax out of the box, I'm not sure
>> of the benefits. It seems like the sandboxing benefits could be
>> achieved by just running two different almond-based builds and having
>> them wrapped via the r.js wrap config option so they do not see each
>> other.

> The benefit is having a loader that isolates different apps/widgets in
> the browser without having to configure anything at build time and
> writing canonical IDs into the bundle files. It completely separates
> building from loading. While the loader does not support AMD syntax
> out of the box it should be trivial to add as an extension. I would be
> happy to explore this if there is interest.

For reference. An AMD compatibility plugin is now planned:
https://github.com/sourcemint/loader-js/issues/6

Christoph


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »