Changing the compiler to output .js files into specific directories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing the compiler to output .js files into specific directories

Andy Burnett
A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

Herby Vojčík
It's called namespace. ;-)

Andy Burnett <[hidden email]>napísal/a:

A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

basilmir
I think he’s trying to say that it would be nice to have a default behavior where the namespace is actually the same this a directory path.

Pe 16.04.2014, la 22:18, Herby Vojčík <[hidden email]> a scris:

It's called namespace. ;-)

Andy Burnett <[hidden email]>napísal/a:

A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

Andy Burnett
Exactly :-)
I need the files to be written to specific folders. 

Unless, Herby are you saying that this is what happens already?

On 16 Apr 2014, at 15:20, "Mircea S." <[hidden email]> wrote:

I think he’s trying to say that it would be nice to have a default behavior where the namespace is actually the same this a directory path.

Pe 16.04.2014, la 22:18, Herby Vojčík <[hidden email]> a scris:

It's called namespace. ;-)

Andy Burnett <[hidden email]>napísal/a:

A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

Herby Vojčík
In reply to this post by Andy Burnett
???

Who is he, me or Andy.
Whay I wantedvto tell, is that Amber has that thing called package namespace and so there is already everything to have files grouped in different locations in place (and used, amber files are loaded from different location than your project code). You just need to start to actively use it (that is, have more namespaces if you want to have files in multiple positions)


"Mircea S." <[hidden email]>napísal/a:

I think he’s trying to say that it would be nice to have a default behavior where the namespace is actually the same this a directory path.

Pe 16.04.2014, la 22:18, Herby Vojčík <[hidden email]> a scris:

It's called namespace. ;-)

Andy Burnett <[hidden email]>napísal/a:

A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

Andy Burnett
That sounds very encouraging :-)

Right, I shall go off and learn about how namespaces are implemented/used in Amber.

Cheers


On Wed, Apr 16, 2014 at 3:36 PM, Herby Vojčík <[hidden email]> wrote:
???

Who is he, me or Andy.
Whay I wantedvto tell, is that Amber has that thing called package namespace and so there is already everything to have files grouped in different locations in place (and used, amber files are loaded from different location than your project code). You just need to start to actively use it (that is, have more namespaces if you want to have files in multiple positions)


"Mircea S." <[hidden email]>napísal/a:


I think he’s trying to say that it would be nice to have a default behavior where the namespace is actually the same this a directory path.

Pe 16.04.2014, la 22:18, Herby Vojčík <[hidden email]> a scris:

It's called namespace. ;-)

Andy Burnett <[hidden email]>napísal/a:

A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

Nicolas Petton

This requires a section in the doc. I'll start writing a page for that.

Nico

On Apr 16, 2014 10:12 PM, "Andy Burnett" <[hidden email]> wrote:
That sounds very encouraging :-)

Right, I shall go off and learn about how namespaces are implemented/used in Amber.

Cheers


On Wed, Apr 16, 2014 at 3:36 PM, Herby Vojčík <[hidden email]> wrote:
???

Who is he, me or Andy.
Whay I wantedvto tell, is that Amber has that thing called package namespace and so there is already everything to have files grouped in different locations in place (and used, amber files are loaded from different location than your project code). You just need to start to actively use it (that is, have more namespaces if you want to have files in multiple positions)


"Mircea S." <[hidden email]>napísal/a:


I think he’s trying to say that it would be nice to have a default behavior where the namespace is actually the same this a directory path.

Pe 16.04.2014, la 22:18, Herby Vojčík <[hidden email]> a scris:

It's called namespace. ;-)

Andy Burnett <[hidden email]>napísal/a:

A number of the web frameworks need to have their .js files placed within a specific directory structure. For example, Meteor makes a distinction between code placed in the /client directory and the /server directory.

In the very short term, we could write some scripts that move specific .js files into the appropriate folders, as soon as they change, but what would be much better is something like:

Object subclass: #MyClass
path: '/myapp/client'
instanceVariableNames:''
...

The compiler would then put the code in the appropriate folder, and Meteor etc. could just carry on serenely without realising that anything was going on.

So, possible? Or, very difficult, and likely to break stuff?

Cheers
Andy

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the compiler to output .js files into specific directories

Herby Vojčík


nicolas petton wrote:
> This requires a section in the doc. I'll start writing a page for that.

As for the motivation for this design decision, two reasons were there:

1. Make loader load packages from multiple locations, to be able to
produce libraries and compose project from multiple libraries;
2. AMD modules need to list their dependencies when define()d.

Thus, fixed-well-known-namespace-per-save/load-location (that often
means, per project / per library) was proposed; and it's deployer's
responsibility to map these namespace to actual location where the
pieces are actually deployed; deployment does not change naming
(important for 2.).

(and because namespace is global, it is needed to pick it so it won't
have name clashes)

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.