question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to publish a library built with ivy

See original GitHub issue

Type of Issue

[x] Feature Request

Description

I have a library that is only for ivy, it uses ivy APIs that are not available in previous versions of the framework. When I tried to publish it, I get the message:

info: err > ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed. Please delete and rebuild the package, without compiling with Ivy, before attempting to publish.

Expected Behaviour

I should be able to publish my library for ivy anyway. I understand that it should be opt-in only because we want to avoid errors, but there should be a better way to allow that than to force me to manually edit the package.json file every time I want to build/publish my lib. Ideally there should be an option in ng-package.json to do that.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr:            5.7.1
@angular/compiler:     9.0.0-rc.5
rollup:                1.25.2
tsickle:               0.37.1
typescript:            3.6.4

cc @alan-agius4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

28reactions
benjamincharitycommented, Apr 6, 2020

@ocombe IMO this should be re-opened. 🙏 I’m not sure what the benefit is for ng-packagr to enforce this limitation. The error makes it sound as if the infrastructure itself doesn’t support Ivy code.

This is giving me flashbacks to the ‘peer dependency vs bundled’ discussions. Best practices do exist, but I’m not sure it should be this tools job to enforce them. This situation feels very similar. Sure, 90% of people should not be publishing public Ivy packages. But as I’ve seen through discussions here and in the Angular issues, there are many teams building and publishing internal packages. AFAIK for those packages only consumed by Ivy applications, there is no actual benefit for consuming VE code vs Ivy code.


Either way, much love and appreciation for all those involved with this tool! ❤️

9reactions
michibcommented, Mar 31, 2020

npm publish --ignore-scripts ignores the prepublishOnly Script (also every other script, but my publishable package.json does not contain any other scripts)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publish Angular 12 library built with ivy to npm - Stack Overflow
For me Setting "enableIvy":false and "compilationMode": "partial" as suggested in many posts throws many recursive errors.
Read more >
The Angular Ivy guide for library authors - DEV Community ‍ ‍
Because of this, Ivy comes with the option to compile libraries ahead-of-time and publish them to a package registry like NPM, ...
Read more >
Understanding Angular Ivy Library Compilation | lacolaco/tech
In this post, I will explain how to compile Angular libraries with Ivy, which is now possible in Angular v11.1, and its details....
Read more >
Ivy Publish Plugin - Gradle User Manual
The Ivy Publish Plugin provides the ability to publish build artifacts in the Apache Ivy format, usually to a repository for consumption by...
Read more >
Creating libraries - Angular
This page provides a conceptual overview of how to create and publish new libraries ... See Building libraries with Ivy for information on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found