Skip to content

Commit

Permalink
Merge branch '4.4' into 5.2
Browse files Browse the repository at this point in the history
* 4.4:
  [symfony#15009] Fix indentation of all diff code blocks
  • Loading branch information
wouterj committed Mar 2, 2021
2 parents d66f89e + 4865b3b commit 947fbd1
Show file tree
Hide file tree
Showing 31 changed files with 326 additions and 326 deletions.
8 changes: 4 additions & 4 deletions configuration/dot-env-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ changes can be made to any Symfony 3.4 or higher app:

.. code-block:: diff
# .gitignore
# ...
# .gitignore
# ...
###> symfony/framework-bundle ###
###> symfony/framework-bundle ###
- /.env
+ /.env.local
+ /.env.local.php
+ /.env.*.local
# ...
# ...
#. Rename ``.env`` to ``.env.local`` and ``.env.dist`` to ``.env``:

Expand Down
10 changes: 5 additions & 5 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ Add the ``use`` statement atop your controller class and then modify

.. code-block:: diff
// src/Controller/LuckyController.php
namespace App\Controller;
// src/Controller/LuckyController.php
namespace App\Controller;
+ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
- class LuckyController
+ class LuckyController extends AbstractController
{
// ...
}
{
// ...
}
That's it! You now have access to methods like :ref:`$this->render() <controller-rendering-templates>`
and many others that you'll learn about next.
Expand Down
14 changes: 7 additions & 7 deletions doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,20 @@ methods:

.. code-block:: diff
// src/Entity/Product.php
// ...
// src/Entity/Product.php
// ...
class Product
{
// ...
class Product
{
// ...
+ /**
+ * @ORM\Column(type="text")
+ */
+ private $description;
// getDescription() & setDescription() were also added
}
// getDescription() & setDescription() were also added
}
The new property is mapped, but it doesn't exist yet in the ``product`` table. No
problem! Generate a new migration:
Expand Down
18 changes: 9 additions & 9 deletions frontend/encore/cdn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ built files are uploaded to the CDN, configure it in Encore:

.. code-block:: diff
// webpack.config.js
// ...
Encore
.setOutputPath('public/build/')
// in dev mode, don't use the CDN
.setPublicPath('/build');
// ...
;
// webpack.config.js
// ...
Encore
.setOutputPath('public/build/')
// in dev mode, don't use the CDN
.setPublicPath('/build');
// ...
;
+ if (Encore.isProduction()) {
+ Encore.setPublicPath('https://my-cool-app.com.global.prod.fastly.net');
Expand Down
8 changes: 4 additions & 4 deletions frontend/encore/copy-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ files into your final output directory.

.. code-block:: diff
// webpack.config.js
// webpack.config.js
Encore
// ...
.setOutputPath('public/build/')
Encore
// ...
.setOutputPath('public/build/')
+ .copyFiles({
+ from: './assets/images',
Expand Down
8 changes: 4 additions & 4 deletions frontend/encore/custom-loaders-plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ to use the `IgnorePlugin`_ (see `moment/moment#2373`_):

.. code-block:: diff
// webpack.config.js
// webpack.config.js
+ var webpack = require('webpack');
Encore
// ...
Encore
// ...
+ .addPlugin(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
;
;
.. _`handlebars-loader`: https://github.com/pcardune/handlebars-loader
.. _`plugins`: https://webpack.js.org/plugins/
Expand Down
8 changes: 4 additions & 4 deletions frontend/encore/dev-server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ server SSL certificate:

.. code-block:: diff
// webpack.config.js
// ...
// webpack.config.js
// ...
+ const path = require('path');
Encore
// ...
Encore
// ...
+ .configureDevServerOptions(options => {
+ options.https = {
Expand Down
10 changes: 5 additions & 5 deletions frontend/encore/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ like ``/myAppSubdir``), you will need to configure that when calling ``Encore.se

.. code-block:: diff
// webpack.config.js
Encore
// ...
// webpack.config.js
Encore
// ...
.setOutputPath('public/build/')
.setOutputPath('public/build/')
- .setPublicPath('/build')
+ // this is your *true* public path
Expand All @@ -76,7 +76,7 @@ like ``/myAppSubdir``), you will need to configure that when calling ``Encore.se
+ // this is now needed so that your manifest.json keys are still `build/foo.js`
+ // (which is a file that's used by Symfony's `asset()` function)
+ .setManifestKeyPrefix('build')
;
;
If you're using the ``encore_entry_script_tags()`` and ``encore_entry_link_tags()``
Twig shortcuts (or are :ref:`processing your assets through entrypoints.json <load-manifest-files>`
Expand Down
14 changes: 7 additions & 7 deletions frontend/encore/legacy-applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jQuery plugins often expect that jQuery is already available via the ``$`` or

.. code-block:: diff
// webpack.config.js
Encore
// ...
// webpack.config.js
Encore
// ...
+ .autoProvidejQuery()
;
;
After restarting Encore, Webpack will look for all uninitialized ``$`` and ``jQuery``
variables and automatically require ``jquery`` and set those variables for you.
Expand Down Expand Up @@ -75,10 +75,10 @@ page, add:

.. code-block:: diff
// webpack.config.js
// webpack.config.js
// require jQuery normally
const $ = require('jquery');
// require jQuery normally
const $ = require('jquery');
+ // create global $ and jQuery variables
+ global.$ = global.jQuery = $;
Expand Down
24 changes: 12 additions & 12 deletions frontend/encore/postcss.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Then, enable the loader in Encore!

.. code-block:: diff
// webpack.config.js
// webpack.config.js
Encore
// ...
Encore
// ...
+ .enablePostCssLoader()
;
;
Because you just modified ``webpack.config.js``, stop and restart Encore.

Expand All @@ -42,18 +42,18 @@ You can also pass options to the `postcss-loader`_ by passing a callback:

.. code-block:: diff
// webpack.config.js
// webpack.config.js
+ const path = require('path');
Encore
// ...
Encore
// ...
+ .enablePostCssLoader((options) => {
+ options.postcssOptions = {
+ // the directory where the postcss.config.js file is stored
+ config: path.resolve(__dirname, 'sub-dir', 'custom.config.js'),
+ };
+ })
;
;
.. _browserslist_package_config:

Expand All @@ -66,25 +66,25 @@ support. The best-practice is to configure this directly in your ``package.json`

.. code-block:: diff
{
{
+ "browserslist": [
+ "defaults"
+ ]
}
}
The ``defaults`` option is recommended for most users and would be equivalent
to the following browserslist:

.. code-block:: diff
{
{
+ "browserslist": [
+ "> 0.5%",
+ "last 2 versions",
+ "Firefox ESR",
+ "not dead"
+ ]
}
}
See `browserslist`_ for more details on the syntax.

Expand Down
10 changes: 5 additions & 5 deletions frontend/encore/reactjs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Enable react in your ``webpack.config.js``:

.. code-block:: diff
// webpack.config.js
// ...
// webpack.config.js
// ...
Encore
// ...
Encore
// ...
+ .enableReactPreset()
;
;
Then restart Encore. When you do, it will give you a command you can run to
Expand Down
28 changes: 14 additions & 14 deletions frontend/encore/simple-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ Great! Use ``import`` to import ``jquery`` and ``greet.js``:

.. code-block:: diff
// assets/app.js
// ...
// assets/app.js
// ...
+ // loads the jquery package from node_modules
+ import jquery from 'jquery';
Expand Down Expand Up @@ -209,13 +209,13 @@ Next, use ``addEntry()`` to tell Webpack to read these two new files when it bui

.. code-block:: diff
// webpack.config.js
Encore
// ...
.addEntry('app', './assets/app.js')
// webpack.config.js
Encore
// ...
.addEntry('app', './assets/app.js')
+ .addEntry('checkout', './assets/checkout.js')
+ .addEntry('account', './assets/account.js')
// ...
// ...
And because you just changed the ``webpack.config.js`` file, make sure to stop
and restart Encore:
Expand All @@ -233,8 +233,8 @@ you need them:

.. code-block:: diff
{# templates/.../checkout.html.twig #}
{% extends 'base.html.twig' %}
{# templates/.../checkout.html.twig #}
{% extends 'base.html.twig' %}
+ {% block stylesheets %}
+ {{ parent() }}
Expand Down Expand Up @@ -263,20 +263,20 @@ file to ``app.scss`` and update the ``import`` statement:

.. code-block:: diff
// assets/app.js
// assets/app.js
- import './styles/app.css';
+ import './styles/app.scss';
Then, tell Encore to enable the Sass pre-processor:

.. code-block:: diff
// webpack.config.js
Encore
// ...
// webpack.config.js
Encore
// ...
+ .enableSassLoader()
;
;
Because you just changed your ``webpack.config.js`` file, you'll need to restart
Encore. When you do, you'll see an error!
Expand Down
24 changes: 12 additions & 12 deletions frontend/encore/split-chunks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ To enable this, call ``splitEntryChunks()``:

.. code-block:: diff
// webpack.config.js
Encore
// ...
// webpack.config.js
Encore
// ...
// multiple entry files, which probably import the same code
.addEntry('app', './assets/app.js')
.addEntry('homepage', './assets/homepage.js')
.addEntry('blog', './assets/blog.js')
.addEntry('store', './assets/store.js')
// multiple entry files, which probably import the same code
.addEntry('app', './assets/app.js')
.addEntry('homepage', './assets/homepage.js')
.addEntry('blog', './assets/blog.js')
.addEntry('store', './assets/store.js')
+ .splitEntryChunks()
Expand Down Expand Up @@ -54,11 +54,11 @@ this plugin with the ``configureSplitChunks()`` function:

.. code-block:: diff
// webpack.config.js
Encore
// ...
// webpack.config.js
Encore
// ...
.splitEntryChunks()
.splitEntryChunks()
+ .configureSplitChunks(function(splitChunks) {
+ // change the configuration
+ splitChunks.minSize = 0;
Expand Down
Loading

0 comments on commit 947fbd1

Please sign in to comment.