Skip to content

Commit

Permalink
feat(zone.js): remove legacy files and access to deep imports
Browse files Browse the repository at this point in the history
This commit removes access to deep imports and `zone-testing-bundle` and `zone-testing-node-bundle`

This commit removed access to deep and legacy `dist` imports. `zone-testing-bundle` and `zone-testing-node-bundle` are also no longer generated.

BREAKING CHANGE:
Deep and legacy `dist/` imports like `zone.js/bundles/zone-testing.js` and `zone.js/dist/zone` are no longer allowed. `zone-testing-bundle` and `zone-testing-node-bundle` are also no longer part of the package.

The proper way to import `zone.js` and `zone.js/testing` is:
```js
import 'zone.js';
import 'zone.js/testing';
```
  • Loading branch information
alan-agius4 committed Sep 13, 2023
1 parent 59387ee commit 816e2f8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 46 deletions.
7 changes: 0 additions & 7 deletions packages/zone.js/bundles.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,4 @@ BUNDLES_ENTRY_POINTS = {
"zone-testing": {
"entrypoint": _DIR + "testing/zone-testing",
},
"zone-testing-bundle": {
"es5": _DIR + "browser/rollup-test-main",
"es2015": _DIR + "browser/rollup-test-main",
},
"zone-testing-node-bundle": {
"entrypoint": _DIR + "node/rollup-test-main",
},
}
12 changes: 0 additions & 12 deletions packages/zone.js/lib/browser/rollup-test-main.ts

This file was deleted.

18 changes: 0 additions & 18 deletions packages/zone.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,6 @@
"./plugins/*": {
"require": "./bundles/*.umd.js",
"default": "./fesm2015/*.js"
},
"./fesm2015/*.js": {
"default": "./fesm2015/*.js"
},
"./fesm2015/*": {
"default": "./fesm2015/*.js"
},
"./bundles/*.js": {
"default": "./bundles/*.js"
},
"./bundles/*": {
"default": "./bundles/*.js"
},
"./dist/*.min": {
"default": "./bundles/*.umd.min.js"
},
"./dist/*": {
"default": "./bundles/*.umd.js"
}
}
}
13 changes: 9 additions & 4 deletions packages/zone.js/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ test_deps = [
test_entry_point = ":browser_entry_point.ts"

karma_tests = {
"browser_test": ["//packages/zone.js/bundles:zone-testing-bundle.umd.js"],
"browser_test": [
"//packages/zone.js/bundles:zone.umd.js",
"//packages/zone.js/bundles:zone-testing.umd.js",
],
"browser_green_test": [
"//packages/zone.js/fesm2015:zone.js",
"//packages/zone.js/fesm2015:zone-testing.js",
Expand All @@ -283,7 +286,8 @@ karma_test(
karma_test(
name = "browser_shadydom",
bootstraps = {"browser_shadydom": [
"//packages/zone.js/bundles:zone-testing-bundle.umd.js",
"//packages/zone.js/bundles:zone.umd.min.js",
"//packages/zone.js/bundles:zone-testing.umd.min.js",
"//packages/zone.js/bundles:webapis-shadydom.umd.js",
]},
ci = False,
Expand All @@ -305,7 +309,8 @@ karma_test(
karma_test(
name = "browser_disable_wrap_uncaught_promise_rejection",
bootstraps = {"browser_disable_wrap_uncaught_promise_rejection": [
"//packages/zone.js/bundles:zone-testing-bundle.umd.js",
"//packages/zone.js/bundles:zone.umd.min.js",
"//packages/zone.js/bundles:zone-testing.umd.min.js",
]},
ci = False,
env_deps = [
Expand All @@ -318,7 +323,7 @@ karma_test(
],
test_entry_point = ":browser_disable_wrap_uncaught_promise_rejection_entry_point.ts",
test_srcs = [
"common/promise-disable-wrap-uncaught-promise-rejection.spec.ts",
"browser_disable_wrap_uncaught_promise_rejection_entry_point.ts",
"common/promise-disable-wrap-uncaught-promise-rejection.spec.ts",
],
)
3 changes: 2 additions & 1 deletion packages/zone.js/test/karma_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def karma_test(name, env_srcs, env_deps, env_entry_point, test_srcs, test_deps,
bootstrap = [
":saucelabs.js",
":" + name + "_env_rollup.umd",
"//packages/zone.js/bundles:zone-testing-bundle.umd.min.js",
"//packages/zone.js/bundles:zone.umd.js",
"//packages/zone.js/bundles:zone-testing.umd.js",
] + _karma_test_required_dist_files,
browsers = ["@npm//@angular/build-tooling/bazel/browsers/chromium:chromium"],
config_file = "//:karma-js.conf.js",
Expand Down
4 changes: 0 additions & 4 deletions packages/zone.js/test/npm_package/npm_package.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ describe('Zone.js npm_package', () => {
'zone-patch-socket-io.min.js',
'zone-patch-user-media.js',
'zone-patch-user-media.min.js',
'zone-testing-bundle.js',
'zone-testing-bundle.min.js',
'zone-testing-node-bundle.js',
'zone-testing-node-bundle.min.js',
'zone-testing.js',
'zone-testing.min.js',
'zone.js',
Expand Down

0 comments on commit 816e2f8

Please sign in to comment.