Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-84639 Add polyfill for Array.fill method #62313

Closed
wants to merge 3 commits into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/apps/asset/asset-link-test/build.gradle
Expand Up @@ -7,12 +7,12 @@ copyLibs {

dependencies {
compileOnly project(":apps:bookmarks:bookmarks-test")
compileOnly project(":apps:journal:journal-test")

testIntegrationCompile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "default"
testIntegrationCompile project(":apps:asset:asset-test-util")
testIntegrationCompile project(":apps:bookmarks:bookmarks-api")
testIntegrationCompile project(":apps:export-import:export-import-test-util")
testIntegrationCompile project(":apps:journal:journal-api")
testIntegrationCompile project(":apps:journal:journal-test-util")
testIntegrationCompile project(":test:arquillian-extension-junit-bridge")
}
3 changes: 1 addition & 2 deletions modules/apps/asset/asset-publisher-test/build.gradle
Expand Up @@ -6,8 +6,6 @@ copyLibs {
}

dependencies {
compileOnly project(":apps:journal:journal-test")

testIntegrationCompile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "default"
testIntegrationCompile project(":apps:asset:asset-publisher-api")
testIntegrationCompile project(":apps:asset:asset-test-util")
Expand All @@ -16,6 +14,7 @@ dependencies {
testIntegrationCompile project(":apps:export-import:export-import-api")
testIntegrationCompile project(":apps:export-import:export-import-test-util")
testIntegrationCompile project(":apps:journal:journal-api")
testIntegrationCompile project(":apps:journal:journal-test-util")
testIntegrationCompile project(":apps:portal:portal-upgrade-api")
testIntegrationCompile project(":core:petra:petra-string")
testIntegrationCompile project(":test:arquillian-extension-junit-bridge")
Expand Down
1 change: 0 additions & 1 deletion modules/apps/export-import/export-import-test/build.gradle
Expand Up @@ -7,7 +7,6 @@ copyLibs {

dependencies {
compileOnly project(":apps:bookmarks:bookmarks-test")
compileOnly project(":apps:journal:journal-test")

testIntegrationCompile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "default"
testIntegrationCompile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "default"
Expand Down
@@ -1,6 +1,7 @@
import com.liferay.gradle.util.copy.StripPathSegmentsAction

configurations {
arrayFill
arrayFind
arrayFrom
fetch
Expand All @@ -10,6 +11,7 @@ configurations {
urlSearchParams
}

task buildArrayFill(type: Copy)
task buildArrayFind(type: Copy)
task buildArrayFrom(type: Copy)
task buildFetch(type: Copy)
Expand All @@ -18,6 +20,22 @@ task buildObjectEntries(type: Copy)
task buildObjectValues(type: Copy)
task buildUrlSearchParams(type: Copy)

buildArrayFill {
eachFile new StripPathSegmentsAction(5)

from {
zipTree(configurations.arrayFill.singleFile)
}

include "META-INF/resources/webjars/array.prototype.fill/1.0.2/index.js"
includeEmptyDirs = false
into "classes/META-INF/resources"

rename {
it.replace "index", "array.fill"
}
}

buildArrayFind {
eachFile new StripPathSegmentsAction(5)

Expand Down Expand Up @@ -127,6 +145,7 @@ buildUrlSearchParams {
}

classes {
dependsOn buildArrayFill
dependsOn buildArrayFind
dependsOn buildArrayFrom
dependsOn buildFetch
Expand All @@ -137,6 +156,8 @@ classes {
}

dependencies {
arrayFill group: "org.webjars.npm", name: "array.prototype.fill", transitive: false, version: "1.0.2"

arrayFind group: "org.webjars.bower", name: "Array.prototype.find", transitive: false, version: "1.0.0"

arrayFrom group: "org.webjars.npm", name: "mdn-polyfills", transitive: false, version: "5.8.0"
Expand Down
Expand Up @@ -71,8 +71,9 @@ public void register(DynamicIncludeRegistry dynamicIncludeRegistry) {
}

private static final String[] _FILE_NAMES = {
"array.find.js", "array.from.js", "fetch.js", "object.assign.js",
"object.entries.js", "object.values.js", "url.search.params.js"
"array.fill.js", "array.find.js", "array.from.js", "fetch.js",
"object.assign.js", "object.entries.js", "object.values.js",
"url.search.params.js"
};

@Reference
Expand Down
3 changes: 1 addition & 2 deletions modules/apps/staging/staging-test/build.gradle
Expand Up @@ -3,12 +3,11 @@ copyLibs {
}

dependencies {
compileOnly project(":apps:journal:journal-test")

testIntegrationCompile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "default"
testIntegrationCompile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "default"
testIntegrationCompile project(":apps:export-import:export-import-changeset-api")
testIntegrationCompile project(":apps:journal:journal-api")
testIntegrationCompile project(":apps:journal:journal-test-util")
testIntegrationCompile project(":apps:staging:staging-api")
testIntegrationCompile project(":core:petra:petra-reflect")
testIntegrationCompile project(":core:petra:petra-string")
Expand Down