Skip to content

Commit 1db34a8

Browse files
committed
feature #1224 Add "type: module" for all packages and changing main -> module (weaverryan)
This PR was merged into the 2.x branch. Discussion ---------- Add "type: module" for all packages and changing main -> module | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Tickets | None | License | MIT Follow up on https://github.com/symfony/ux/pull/1202/files#r1367791334 We already use ESM inside of our packages. This makes that official with `type: module`. Some notes / questions: A) I believe, since we already ONLY made "modules" available, that this will have no effect on end users, but I'm not 100% sure about that. If someone is using `require` instead of `import`, it would affect them... but in that case, I believe `require` would not have worked before anyway. But if anyone knows better than I do, I'd appreciate your notes. B) Because we are a `type: module`, my impression is that `main` will not be used. And we can instead rely on `module`. tl;dr I believe these changes won't have user-facing effects, but I'm not 100% sure about that... though I'm pretty sure that if they DO have user-facing effects, it would be limited to people who are currently using `require` with these packages. Cheers! Commits ------- 592be5e Specifically adding type: module for all packages and changing main -> module
2 parents 9d293b6 + 592be5e commit 1db34a8

File tree

16 files changed

+31
-16
lines changed

16 files changed

+31
-16
lines changed

src/Autocomplete/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "@symfony/ux-autocomplete",
33
"description": "JavaScript-powered autocompletion functionality for forms.",
4-
"main": "dist/controller.js",
4+
"module": "dist/controller.js",
5+
"type": "module",
56
"types": "dist/controller.d.ts",
67
"version": "1.0.0",
78
"license": "MIT",

src/Chartjs/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Chart.js integration for Symfony",
44
"license": "MIT",
55
"version": "1.1.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"symfony": {
910
"controllers": {

src/Cropperjs/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Cropper.js integration for Symfony",
44
"license": "MIT",
55
"version": "1.1.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"config": {
910
"css_source": "src/style.css"

src/Dropzone/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "File input dropzones for Symfony Forms",
44
"license": "MIT",
55
"version": "1.1.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"config": {
910
"css_source": "src/style.css"

src/LazyImage/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Lazy image loader and utilities for Symfony",
44
"license": "MIT",
55
"version": "1.1.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"symfony": {
910
"controllers": {

src/LiveComponent/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "@symfony/ux-live-component",
33
"description": "Live Component: bring server-side re-rendering & model binding to any element.",
4-
"main": "dist/live_controller.js",
4+
"module": "dist/live_controller.js",
5+
"type": "module",
56
"types": "dist/live_controller.d.ts",
67
"version": "1.0.0",
78
"config": {

src/Notify/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Native notification integration for Symfony using Mercure",
44
"license": "MIT",
55
"version": "1.0.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"symfony": {
910
"controllers": {

src/React/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Integration of React in Symfony",
44
"license": "MIT",
55
"version": "1.0.0",
6-
"main": "dist/register_controller.js",
6+
"module": "dist/register_controller.js",
7+
"type": "module",
78
"types": "dist/register_controller.d.ts",
89
"symfony": {
910
"controllers": {

src/StimulusBundle/assets/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"description": "Integration of @hotwired/stimulus into Symfony",
44
"version": "1.0.0",
55
"license": "MIT",
6+
"module": "dist/loader.js",
7+
"type": "module",
68
"symfony": {
79
"needsPackageAsADependency": false,
810
"importmap": {

src/Svelte/assets/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"name": "@symfony/ux-svelte",
33
"description": "Integration of Svelte in Symfony",
4-
"main": "dist/register_controller.js",
54
"module": "dist/register_controller.js",
5+
"type": "module",
66
"version": "1.0.0",
77
"license": "MIT",
8-
"type": "module",
98
"symfony": {
109
"controllers": {
1110
"svelte": {

src/Swup/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Swup integration for Symfony",
44
"license": "MIT",
55
"version": "1.1.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"symfony": {
910
"controllers": {

src/TogglePassword/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Toggle visibility of password inputs for Symfony Forms",
44
"license": "MIT",
55
"version": "1.0.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"config": {
910
"css_source": "src/style.css"

src/Translator/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Symfony Translator for JavaScript",
44
"license": "MIT",
55
"version": "1.0.0",
6-
"main": "dist/translator_controller.js",
6+
"module": "dist/translator_controller.js",
7+
"type": "module",
78
"types": "dist/translator_controller.d.ts",
89
"symfony": {
910
"importmap": {

src/Turbo/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"license": "MIT",
55
"private": true,
66
"version": "0.1.0",
7-
"main": "dist/turbo_controller.js",
7+
"module": "dist/turbo_controller.js",
8+
"type": "module",
89
"types": "dist/turbo_controller.d.ts",
910
"symfony": {
1011
"controllers": {

src/Typed/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Typed integration for Symfony",
44
"license": "MIT",
55
"version": "1.0.0",
6-
"main": "dist/controller.js",
6+
"module": "dist/controller.js",
7+
"type": "module",
78
"types": "dist/controller.d.ts",
89
"symfony": {
910
"controllers": {

src/Vue/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Integration of Vue.js in Symfony",
44
"license": "MIT",
55
"version": "1.0.0",
6-
"main": "dist/register_controller.js",
6+
"module": "dist/register_controller.js",
7+
"type": "module",
78
"types": "dist/register_controller.d.ts",
89
"symfony": {
910
"controllers": {

0 commit comments

Comments
 (0)