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

Any way to use ts-loader ^5.1.1 or newer? #431

Closed
msheakoski opened this issue Nov 7, 2018 · 4 comments
Closed

Any way to use ts-loader ^5.1.1 or newer? #431

msheakoski opened this issue Nov 7, 2018 · 4 comments
Labels

Comments

@msheakoski
Copy link

It's nice to be able to periodically run yarn upgrade --latest and have your package.json update to the latest versions of everything, but ts-loader on encore 0.21 seems to be locked at ^4.3.0 and instead I need to manually type out every dependency to update minus ts-loader to avoid getting the newer version. This was also an issue with encore 0.20 which was locked into an even older version of ts-loader and I was surprised to see the same issue on the latest encore.

Is it possible to bump the dependency requirement to ^5.1.1 which is the oldest 5.x version that contains a bug fix?

@weaverryan
Copy link
Member

Hey @msheakoski!

Hmm. Actually, ts-loader is not required by Encore at all - it's only listed as a "dev" dependency so that we can use it in our tests:

"ts-loader": "^4.3.0",
. We should bump that, but it should not affect your project at all. You are responsible for adding ts-loader to your package.json and managing whatever version you need.

Are you seeing something different? Is ts-loader not your package.json? Note, in 0.20, you will now receive a warning that you're using a version of ts-loader that Encore isn't tested against. That's why we should bump our dependency. But, this is just a warning - it does not affect any functionality.

Cheers!

@msheakoski
Copy link
Author

@weaverryan I have ts-loader under devDependencies because that is what the documentation advised as of 0.20. I noticed that the docs have since changed to allow for encore to prompt for missing packages, but even then, it is suggested to install as a dev dependency:

yarn run v1.12.1
$ encore dev
Running webpack ...

  Error: Install ts-loader to use enableTypeScriptLoader()
    yarn add ts-loader@^4.3.0 --dev
  
  - package-helper.js:21 Object.ensurePackagesExist
    [landing-pages]/[@symfony]/webpack-encore/lib/package-helper.js:21:15

Should dependencies now be installed as non-dev?

@stof
Copy link
Member

stof commented Nov 8, 2018

well, it depends whether you run encore on a server where you install dev dependencies or no. What is important is that ts-loader is installed when you run encore.

@msheakoski
Copy link
Author

The most DX-friendly route in my opinion is to keep the package install suggestions as dev dependencies and bump ts-loader to at least ^5.0.0.

Although most Symfony users would be fine installing packages as either dev or non-dev, there may be some projects that have Symfony plus supporting Node.js code (maybe a websocket server for example) in the same repo and they would not want build-time packages installed in the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants