Optionally make affected algorithm more precise #5919
vigie
started this conversation in
Feature Requests
Replies: 1 comment 2 replies
-
hi Matt, this is an interesting proposal. Can you provide an example of such |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Apologies if this is being discussed elsewhere, I did look....
Currently
projA
is affected byprojB
ifprojA
imports anything fromprojB
.This is as conservative and fool proof as possible. It also however often results in too much building/testing when
projB
for example contains a set of pure utility functions.I have read the discussions where the answer at this point is to "refactor
projB
". I don't want to go down that route here. Let's assume we wish to let developers decide how to best organize their code as far as possible.The proposal is to allow affected to actually analyze what is being imported from
projB
before declaring that it has been affected by a change toprojB
.In order to do this safely, affected would have to assume
projB
is a pure project, that is, the exporting and usage of items fromprojB
does not trigger side effects. For example, there is no arbitrary code inprojB
's index.ts file doing weird stuff in global space.In general (unfortunately), this is not a safe assumption to make. So the proposal is to provide a mechanism to allow users to declare certain libraries as "pure", in order to benefit from the optimized algorithm.
This could be done as simply as adding a new
pure
property to projects innx.json
, for example.Beta Was this translation helpful? Give feedback.
All reactions