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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AssetMapper] gitignore /assets/vendor/ as a directory #1264

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

kaznovac
Copy link
Contributor

@kaznovac kaznovac commented Dec 5, 2023

this is more to be consistent with the /public/assets/ gitignore line above the fixed one; the set line is just fine

Q A
License MIT
Doc issue/PR

this is more to be consistent with the `/public/assets/` gitignore line above the fixed one; the set line is just fine
@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) December 5, 2023 11:16
Copy link

github-actions bot commented Dec 5, 2023

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1264/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1264/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/asset-mapper:^6.4'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

symfony/asset-mapper

6.3 vs 6.4
diff --git a/symfony/asset-mapper/6.3/assets/app.js b/symfony/asset-mapper/6.4/assets/app.js
index cb0082a..e3b03ad 100644
--- a/symfony/asset-mapper/6.3/assets/app.js
+++ b/symfony/asset-mapper/6.4/assets/app.js
@@ -4,4 +4,6 @@
  * This file will be included onto the page via the importmap() Twig function,
  * which should already be in your base.html.twig.
  */
+import './styles/app.css'
+
 console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉')
diff --git a/symfony/asset-mapper/6.3/importmap.php b/symfony/asset-mapper/6.4/importmap.php
index 5c2c21d..9be0d4c 100644
--- a/symfony/asset-mapper/6.3/importmap.php
+++ b/symfony/asset-mapper/6.4/importmap.php
@@ -6,8 +6,8 @@
  * - "path" is a path inside the asset mapper system. Use the
  *     "debug:asset-map" command to see the full list of paths.
  *
- * - "preload" set to true for any modules that are loaded on the initial
- *     page load to help the browser download them earlier.
+ * - "entrypoint" (JavaScript only) set to true for any module that will
+ *     be used as an "entrypoint" (and passed to the importmap() Twig function).
  *
  * The "importmap:require" command can be used to add new entries to this file.
  *
@@ -15,7 +15,7 @@
  */
 return [
     'app' => [
-        'path' => 'app.js',
-        'preload' => true,
+        'path' => './assets/app.js',
+        'entrypoint' => true,
     ],
 ];
diff --git a/symfony/asset-mapper/6.3/manifest.json b/symfony/asset-mapper/6.4/manifest.json
index c6fb477..eecf6ae 100644
--- a/symfony/asset-mapper/6.3/manifest.json
+++ b/symfony/asset-mapper/6.4/manifest.json
@@ -6,22 +6,16 @@
     },
     "aliases": ["asset-mapper", "importmap"],
     "gitignore": [
-        "/%PUBLIC_DIR%/assets/"
+        "/%PUBLIC_DIR%/assets/",
+        "/assets/vendor/"
     ],
     "add-lines": [
         {
             "file": "templates/base.html.twig",
-            "content": "            {{ importmap() }}",
+            "content": "            {{ importmap('app') }}",
             "position": "after_target",
             "target": "{% block javascripts %}",
             "warn_if_missing": true
-        },
-        {
-            "file": "templates/base.html.twig",
-            "content": "            <link rel=\"stylesheet\" href=\"{{ asset('styles/app.css') }}\">",
-            "position": "after_target",
-            "target": "{% block stylesheets %}",
-            "warn_if_missing": true
         }
     ],
     "conflict": {

@fabpot fabpot disabled auto-merge January 18, 2024 06:52
@fabpot fabpot merged commit cb7411b into symfony:main Jan 18, 2024
1 of 2 checks passed
@kaznovac kaznovac deleted the patch-3 branch January 22, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants