Skip to content

Commit

Permalink
[symfony#15009] Fix indentation of all diff code blocks
Browse files Browse the repository at this point in the history
Co-authored-by: Jérémy Derussé <[email protected]>
  • Loading branch information
wouterj and jderusse committed Mar 2, 2021
1 parent 8132571 commit 4865b3b
Show file tree
Hide file tree
Showing 32 changed files with 343 additions and 343 deletions.
8 changes: 4 additions & 4 deletions configuration/dot-env-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,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
24 changes: 12 additions & 12 deletions frontend/encore/dev-server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,29 @@ the ``package.json`` file:

.. code-block:: diff
{
...
"scripts": {
{
...
"scripts": {
- "dev-server": "encore dev-server",
+ "dev-server": "encore dev-server --https --pfx=$HOME/.symfony/certs/default.p12 --allowed-hosts=mydomain.wip",
...
}
}
...
}
}
If you experience issues related to CORS (Cross Origin Resource Sharing), add
the ``--disable-host-check`` and ``--port`` options to the ``dev-server``
command in the ``package.json`` file:

.. code-block:: diff
{
...
"scripts": {
{
...
"scripts": {
- "dev-server": "encore dev-server",
+ "dev-server": "encore dev-server --port 8080 --disable-host-check",
...
}
}
...
}
}
.. caution::

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,17 +42,17 @@ You can also pass options to the `postcss-loader`_ by passing a callback:

.. code-block:: diff
// webpack.config.js
// webpack.config.js
Encore
// ...
Encore
// ...
+ .enablePostCssLoader((options) => {
+ options.config = {
+ // the directory where the postcss.config.js file is stored
+ path: 'path/to/config'
+ };
+ })
;
;
.. _browserslist_package_config:

Expand All @@ -65,25 +65,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
10 changes: 5 additions & 5 deletions frontend/encore/shared-entry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Update your code to use ``createSharedEntry()``:

.. code-block:: diff
Encore
// ...
Encore
// ...
- .addEntry('app', './assets/js/app.js')
+ .createSharedEntry('app', './assets/js/app.js')
.addEntry('homepage', './assets/js/homepage.js')
.addEntry('blog', './assets/js/blog.js')
.addEntry('store', './assets/js/store.js')
.addEntry('homepage', './assets/js/homepage.js')
.addEntry('blog', './assets/js/blog.js')
.addEntry('store', './assets/js/store.js')
Before making this change, if both ``app.js`` and ``store.js`` require ``jquery``,
then ``jquery`` would be packaged into *both* files, which is wasteful. By making
Expand Down
Loading

0 comments on commit 4865b3b

Please sign in to comment.