Skip to content

[Webpack Encore] always show examples with npm #15575

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

Closed
Seb33300 opened this issue Aug 2, 2021 · 5 comments
Closed

[Webpack Encore] always show examples with npm #15575

Seb33300 opened this issue Aug 2, 2021 · 5 comments
Labels
help wanted Issues and PRs which are looking for volunteers to complete them.

Comments

@Seb33300
Copy link
Contributor

Seb33300 commented Aug 2, 2021

Is there any reason to favor yarn over npmcommand lines in webpack encore documentation?

Some examples in the documentation are only available with yarn command and the installation example with npm is in the section "for non Symfony applications" so people may think that installing yarn is required when using Symfony.

I dont know if the documentation website supports it for command lines, but I think it could be nice to have all examples in both npm & yarn using the same tab feature we can see on some other pages (to switch between annotations, YAML, XML, ...)

image

And maybe display npm by default, because this is the tool required to install. Yarn is optional.

@Seb33300 Seb33300 changed the title Webpack encore: always show examples with npm [Webpack Encore] always show examples with npm Aug 2, 2021
@javiereguiluz
Copy link
Member

We did that because, after evaluating both tools, we decided that Yarn worked much better (and faster) than npm. But yes, we should display both commands always. So, someone with enough experience in "npm" needs to help us submitting a Pull Request with the needed changes. If there are lots of changes, it's OK to do separate PRs. Also, PRs should be created against 4.4 branch. Thanks!

@javiereguiluz javiereguiluz added the help wanted Issues and PRs which are looking for volunteers to complete them. label Aug 2, 2021
@havijs
Copy link
Contributor

havijs commented Aug 14, 2021

Hi I'm new :D but I'd like to help. Is this format OK?

$ yarn command

# if you prefer npm, run:
$ npm relative command

@Seb33300
Copy link
Contributor Author

I think it's better if we can use tabs but I don't know if this is possible with console code

@havijs
Copy link
Contributor

havijs commented Aug 14, 2021

I think it's better if we can use tabs but I don't know if this is possible with console code

What about something like this?

.. configuration-block::

    .. code-block:: terminal+yarn
        # yarn command
    .. code-block:: terminal+npm
        # npm command

There is a list of supported formats here which I don't know where these markup formats are defined.

@OskarStark
Copy link
Contributor

just use terminal for both code blocks

javiereguiluz added a commit that referenced this issue Sep 22, 2021
This PR was merged into the 4.4 branch.

Discussion
----------

resolves #15575

Add npm equivalent of yarn commands in separate tabs.
<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `5.x` for features of unreleased versions).

-->

Commits
-------

b9cfe08 resolves #15575 add npm equivalent of yarn commands in a separate code block.
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this issue Sep 22, 2021
* 4.4:
  resolves symfony#15575 add npm equivalent of yarn commands in a separate code block.
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this issue Sep 22, 2021
* 5.3:
  resolves symfony#15575 add npm equivalent of yarn commands in a separate code block.
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this issue Sep 22, 2021
* 5.4:
  resolves symfony#15575 add npm equivalent of yarn commands in a separate code block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues and PRs which are looking for volunteers to complete them.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants