mirror of
https://github.com/cincheo/jsweet.git
synced 2025-12-14 23:09:22 +00:00
deprecated @Ambient annotation
@Ambient annotation was used to inline declarations. However they suffer from the Java packages structure, which is less flexible than namespaces in TypeScript. Since @Ambient are always defined in the package they appear, they are not convenient when working out of the root package. Plus, now that def.* packages are working well in version 2, the @Ambient annotation is redundant with using def.* packages. So, it was decided that all ambient declarations should be defined in def.* packages, thus forcing the developers to cleanly separate the actual implementation from the bridges to external libraries. We believe it is good practice to do so in Java in order to have a better-structured program.
This commit is contained in:
parent
c6a468998e
commit
7cee074faa
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package jsweet.lang;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@ -57,10 +56,12 @@ import def.js.String;
|
||||
* <p>
|
||||
* This solution is cleaner than using the {@link Object#$get(String)} function,
|
||||
* which is not typed.
|
||||
*
|
||||
* @deprecated Please use a <code>def.*</code> package for declarations.
|
||||
*/
|
||||
@Deprecated
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD })
|
||||
@Documented
|
||||
public @interface Ambient {
|
||||
|
||||
}
|
||||
|
||||
@ -57,7 +57,10 @@ import def.js.String;
|
||||
* <p>
|
||||
* This solution is cleaner than using the {@link Object#$get(String)} function,
|
||||
* which is not typed.
|
||||
*
|
||||
* @deprecated Please use a <code>def.*</code> package for declarations.
|
||||
*/
|
||||
@Deprecated
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD })
|
||||
@Documented
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user