Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .codefresh/codefresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ steps:
commands:
# Install dependencies
- yarn install --frozen-lockfile --non-interactive --network-timeout 100000 --no-progress
# Create symlinks needed for Windows.
- scripts\windows\create-symlinks.cmd
# Add Bazel CI config
- copy .codefresh\bazel.rc %ProgramData%\bazel.bazelrc
# Run tests
Expand Down
10 changes: 0 additions & 10 deletions aio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ Here are the most important tasks you might need to use:
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder

## Developing on Windows
The `packages/` directory may contain Linux-specific symlinks, which are not recognized by Windows.
These unresolved links cause the docs generation process to fail because it cannot locate certain files.

> Hint: The following steps require administration rights or [Windows Developer Mode](https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development) enabled!

To fix this problem, run `scripts/windows/create-symlinks.sh`. This command creates temporary files where the symlinks used to be. Make sure not to commit those files with your documentation changes.
When you are done making and testing your documentation changes, you can restore the original symlinks and delete the temporary files by running `scripts/windows/remove-symlinks.sh`.

It's necessary to remove the temporary files, because otherwise they're displayed as local changes in your git working copy and certain operations are blocked.

## Using ServiceWorker locally

Expand Down
12 changes: 0 additions & 12 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@ Next, install the JavaScript modules needed to build and test Angular:
yarn install
```

## Windows only

In order to create the right symlinks, run **as administrator**:
```shell
./scripts/windows/create-symlinks.sh
```

Before submitting a PR, do not forget to remove them:
```shell
./scripts/windows/remove-symlinks.sh
```

## Building

To build Angular run:
Expand Down
5 changes: 2 additions & 3 deletions packages/upgrade/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ ng_module(
srcs = glob(
[
"*.ts",
"src/common/**/*.ts",
"src/dynamic/**/*.ts",
"src/dynamic/src/*.ts",
],
),
deps = [
"//packages/core",
"//packages/platform-browser",
"//packages/platform-browser-dynamic",
"//packages/upgrade/src/common",
"@npm//zone.js",
Comment thread
petebacondarwin marked this conversation as resolved.
Resolved
],
)
Expand Down
4 changes: 2 additions & 2 deletions packages/upgrade/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Entry point for all public APIs of this package. allowing
* Angular 1 and Angular 2+ to run side by side in the same application.
*/
export {VERSION} from './src/common/version';
export {UpgradeAdapter, UpgradeAdapterRef} from './src/dynamic/upgrade_adapter';
export {VERSION} from './src/common/src/version';
export {UpgradeAdapter, UpgradeAdapterRef} from './src/dynamic/src/upgrade_adapter';

// This file only re-exports content of the `src` folder. Keep it that way.
16 changes: 16 additions & 0 deletions packages/upgrade/src/common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("//tools:defaults.bzl", "ts_library")

package(default_visibility = [
"//packages/upgrade:__subpackages__",
"//tools/public_api_guard:__subpackages__",
])

ts_library(
name = "common",
srcs = glob([
"src/**/*.ts",
]),
deps = [
"//packages/core",
],
)
23 changes: 23 additions & 0 deletions packages/upgrade/src/common/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")

ts_library(
name = "test_lib",
testonly = True,
srcs = glob(["**/*.ts"]),
deps = [
"//packages/core",
"//packages/core/testing",
"//packages/upgrade/src/common",
"//packages/upgrade/src/common/test/helpers",
],
)

ts_web_test_suite(
name = "test",
static_files = [
"//:angularjs_scripts",
],
deps = [
":test_lib",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {PropertyBinding} from '@angular/upgrade/src/common/component_info';
import {PropertyBinding} from '../src/component_info';

{
describe('PropertyBinding', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*/
import {Compiler, Component, ComponentFactory, Injector, NgModule, TestabilityRegistry} from '@angular/core';
import {TestBed} from '@angular/core/testing';
import * as angular from '@angular/upgrade/src/common/angular1';
import {DowngradeComponentAdapter, groupNodesBySelector} from '@angular/upgrade/src/common/downgrade_component_adapter';
import * as angular from '../src/angular1';
import {DowngradeComponentAdapter, groupNodesBySelector} from '../src/downgrade_component_adapter';

import {nodes, withEachNg1Version} from './test_helpers';
import {nodes, withEachNg1Version} from './helpers/common_test_helpers';

withEachNg1Version(() => {
describe('DowngradeComponentAdapter', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*/

import {Injector} from '@angular/core';
import * as angular from '@angular/upgrade/src/common/angular1';
import {$INJECTOR, INJECTOR_KEY, UPGRADE_APP_TYPE_KEY} from '@angular/upgrade/src/common/constants';
import {downgradeInjectable} from '@angular/upgrade/src/common/downgrade_injectable';
import {UpgradeAppType} from '@angular/upgrade/src/common/util';
import * as angular from '../src/angular1';
import {$INJECTOR, INJECTOR_KEY, UPGRADE_APP_TYPE_KEY} from '../src/constants';
import {downgradeInjectable} from '../src/downgrade_injectable';
import {UpgradeAppType} from '../src/util';

describe('downgradeInjectable', () => {
const setupMockInjectors = (downgradedModule = '') => {
Expand Down
14 changes: 14 additions & 0 deletions packages/upgrade/src/common/test/helpers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("//tools:defaults.bzl", "ts_library")

package(default_visibility = ["//packages/upgrade:__subpackages__"])

ts_library(
name = "helpers",
srcs = glob([
"*.ts",
]),
deps = [
"//packages/core/testing",
"//packages/upgrade/src/common",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {setAngularJSGlobal} from '@angular/upgrade/src/common/angular1';
import {setAngularJSGlobal} from '../../src/angular1';

// Whether the upgrade tests should run against AngularJS minified or not. This can be
// temporarily switched to "false" in order to make it easy to debug AngularJS locally.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import {Compiler, CompilerOptions, Injector, NgModule, NgModuleRef, NgZone, StaticProvider, Testability, Type, resolveForwardRef} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';

import {IAngularBootstrapConfig, IAugmentedJQuery, IInjectorService, IModule, IProvideService, IRootScopeService, ITestabilityService, bootstrap, element as angularElement, module as angularModule} from '../common/angular1';
import {$$TESTABILITY, $COMPILE, $INJECTOR, $ROOT_SCOPE, COMPILER_KEY, INJECTOR_KEY, LAZY_MODULE_REF, NG_ZONE_KEY, UPGRADE_APP_TYPE_KEY} from '../common/constants';
import {downgradeComponent} from '../common/downgrade_component';
import {downgradeInjectable} from '../common/downgrade_injectable';
import {Deferred, LazyModuleRef, UpgradeAppType, controllerKey, onError} from '../common/util';
import {IAngularBootstrapConfig, IAugmentedJQuery, IInjectorService, IModule, IProvideService, IRootScopeService, ITestabilityService, bootstrap, element as angularElement, module as angularModule} from '../../common/src/angular1';
import {$$TESTABILITY, $COMPILE, $INJECTOR, $ROOT_SCOPE, COMPILER_KEY, INJECTOR_KEY, LAZY_MODULE_REF, NG_ZONE_KEY, UPGRADE_APP_TYPE_KEY} from '../../common/src/constants';
import {downgradeComponent} from '../../common/src/downgrade_component';
import {downgradeInjectable} from '../../common/src/downgrade_injectable';
import {Deferred, LazyModuleRef, UpgradeAppType, controllerKey, onError} from '../../common/src/util';

import {UpgradeNg1ComponentAdapterBuilder} from './upgrade_ng1_adapter';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import {Directive, DoCheck, ElementRef, EventEmitter, Inject, Injector, OnChanges, OnDestroy, OnInit, SimpleChange, SimpleChanges, Type} from '@angular/core';

import {IAttributes, IDirective, IDirectivePrePost, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../common/angular1';
import {$SCOPE} from '../common/constants';
import {IBindingDestination, IControllerInstance, UpgradeHelper} from '../common/upgrade_helper';
import {isFunction, strictEquals} from '../common/util';
import {IAttributes, IDirective, IDirectivePrePost, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../../common/src/angular1';
import {$SCOPE} from '../../common/src/constants';
import {IBindingDestination, IControllerInstance, UpgradeHelper} from '../../common/src/upgrade_helper';
import {isFunction, strictEquals} from '../../common/src/util';


const CAMEL_CASE = /([A-Z])/g;
Expand Down
28 changes: 28 additions & 0 deletions packages/upgrade/src/dynamic/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")

ts_library(
name = "test_lib",
testonly = True,
srcs = glob([
"**/*.ts",
]),
deps = [
"//packages/core",
"//packages/core/testing",
"//packages/platform-browser",
"//packages/platform-browser-dynamic",
"//packages/upgrade",
"//packages/upgrade/src/common",
"//packages/upgrade/src/common/test/helpers",
],
)

ts_web_test_suite(
name = "test",
static_files = [
"//:angularjs_scripts",
],
deps = [
":test_lib",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import {ChangeDetectorRef, Component, EventEmitter, Input, NO_ERRORS_SCHEMA, NgM
import {async, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
import {BrowserModule} from '@angular/platform-browser';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import * as angular from '@angular/upgrade/src/common/angular1';
import {$EXCEPTION_HANDLER} from '@angular/upgrade/src/common/constants';
import {UpgradeAdapter, UpgradeAdapterRef} from '@angular/upgrade/src/dynamic/upgrade_adapter';

import {$apply, $digest, html, multiTrim, withEachNg1Version} from './test_helpers';
import * as angular from '../../common/src/angular1';
import {$EXCEPTION_HANDLER, $ROOT_SCOPE} from '../../common/src/constants';
import {html, multiTrim, withEachNg1Version} from '../../common/test/helpers/common_test_helpers';

import {UpgradeAdapter, UpgradeAdapterRef} from '../src/upgrade_adapter';


declare global {
export var inject: Function;
Expand Down Expand Up @@ -3280,3 +3282,13 @@ withEachNg1Version(() => {
});
});
});

function $apply(adapter: UpgradeAdapterRef, exp: angular.Ng1Expression) {
const $rootScope = adapter.ng1Injector.get($ROOT_SCOPE) as angular.IRootScopeService;
$rootScope.$apply(exp);
}

function $digest(adapter: UpgradeAdapterRef) {
const $rootScope = adapter.ng1Injector.get($ROOT_SCOPE) as angular.IRootScopeService;
$rootScope.$digest();
}
7 changes: 2 additions & 5 deletions packages/upgrade/static/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ exports_files(["package.json"])

ng_module(
name = "static",
# Note: There is Bazel issue where Windows symlinks
# aka. junctions are not traversed by glob.
srcs = glob(
[
"*.ts",
"src/common/**/*.ts",
"src/static/**/*.ts",
"src/*.ts",
Comment thread
petebacondarwin marked this conversation as resolved.
Resolved
],
),
deps = [
"//packages/core",
"//packages/platform-browser",
"//packages/platform-browser-dynamic",
"//packages/upgrade/src/common",
],
)
22 changes: 8 additions & 14 deletions packages/upgrade/static/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/

/**
* @module
* @description
* Entry point for all public APIs of this package. allowing
* Angular 1 and Angular 2+ to run side by side in the same application.
*/
export {getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib} from './src/common/angular1';
export {downgradeComponent} from './src/common/downgrade_component';
export {downgradeInjectable} from './src/common/downgrade_injectable';
export {VERSION} from './src/common/version';
export {downgradeModule} from './src/static/downgrade_module';
export {UpgradeComponent} from './src/static/upgrade_component';
export {UpgradeModule} from './src/static/upgrade_module';
export {getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib} from '../src/common/src/angular1';
export {downgradeComponent} from '../src/common/src/downgrade_component';
export {downgradeInjectable} from '../src/common/src/downgrade_injectable';
export {VERSION} from '../src/common/src/version';
export {downgradeModule} from './src/downgrade_module';
export {UpgradeComponent} from './src/upgrade_component';
export {UpgradeModule} from './src/upgrade_module';


// This file only re-exports content of the `src` folder. Keep it that way.
// This file only re-exports items to appear in the public api. Keep it that way.
1 change: 0 additions & 1 deletion packages/upgrade/static/src

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {IInjectorService} from '../common/angular1';
import {IInjectorService} from '../../src/common/src/angular1';

// We have to do a little dance to get the ng1 injector into the module injector.
// We store the ng1 injector so that the provider in the module injector can access it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import {Injector, NgModuleFactory, NgModuleRef, StaticProvider} from '@angular/core';
import {platformBrowser} from '@angular/platform-browser';

import {IInjectorService, IProvideService, module as angularModule} from '../common/angular1';
import {$INJECTOR, $PROVIDE, DOWNGRADED_MODULE_COUNT_KEY, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../common/constants';
import {LazyModuleRef, UpgradeAppType, getDowngradedModuleCount, isFunction} from '../common/util';
import {IInjectorService, IProvideService, module as angularModule} from '../../src/common/src/angular1';
import {$INJECTOR, $PROVIDE, DOWNGRADED_MODULE_COUNT_KEY, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';
import {LazyModuleRef, UpgradeAppType, getDowngradedModuleCount, isFunction} from '../../src/common/src/util';

import {angular1Providers, setTempInjectorRef} from './angular1_providers';
import {NgAdapterInjector} from './util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import {DoCheck, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges, ɵlooseIdentical as looseIdentical} from '@angular/core';

import {IAttributes, IAugmentedJQuery, IDirective, IDirectivePrePost, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../common/angular1';
import {$SCOPE} from '../common/constants';
import {IBindingDestination, IControllerInstance, UpgradeHelper} from '../common/upgrade_helper';
import {isFunction} from '../common/util';
import {IAttributes, IAugmentedJQuery, IDirective, IDirectivePrePost, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../../src/common/src/angular1';
import {$SCOPE} from '../../src/common/src/constants';
import {IBindingDestination, IControllerInstance, UpgradeHelper} from '../../src/common/src/upgrade_helper';
import {isFunction} from '../../src/common/src/util';

const NOT_SUPPORTED: any = 'NOT_SUPPORTED';
const INITIAL_VALUE = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import {Injector, NgModule, NgZone, Testability} from '@angular/core';

import {IInjectorService, IIntervalService, IProvideService, ITestabilityService, bootstrap, element as angularElement, module as angularModule} from '../common/angular1';
import {$$TESTABILITY, $DELEGATE, $INJECTOR, $INTERVAL, $PROVIDE, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../common/constants';
import {LazyModuleRef, UpgradeAppType, controllerKey} from '../common/util';
import {IInjectorService, IIntervalService, IProvideService, ITestabilityService, bootstrap, element as angularElement, module as angularModule} from '../../src/common/src/angular1';
import {$$TESTABILITY, $DELEGATE, $INJECTOR, $INTERVAL, $PROVIDE, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';
import {LazyModuleRef, UpgradeAppType, controllerKey} from '../../src/common/src/util';

import {angular1Providers, setTempInjectorRef} from './angular1_providers';
import {NgAdapterInjector} from './util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
ts_library(
name = "test_lib",
testonly = True,
srcs = glob(["**/*.ts"]),
srcs = glob([
"**/*.ts",
]),
deps = [
"//packages:types",
"//packages/core",
"//packages/core/testing",
"//packages/platform-browser",
"//packages/platform-browser-dynamic",
"//packages/platform-browser/testing",
"//packages/upgrade",
"//packages/upgrade/src/common",
"//packages/upgrade/src/common/test/helpers",
"//packages/upgrade/static",
"@npm//rxjs",
],
)

ts_web_test_suite(
name = "test_web",
name = "test",
static_files = [
"//:angularjs_scripts",
],
Expand Down
Loading