Skip to content

refactor: re-order fields in JsInfo for readability#1648

Merged
gregmagolan merged 1 commit into
2.xfrom
rjs2_target_bin_dir_js_info
Apr 15, 2024
Merged

refactor: re-order fields in JsInfo for readability#1648
gregmagolan merged 1 commit into
2.xfrom
rjs2_target_bin_dir_js_info

Conversation

@gregmagolan

@gregmagolan gregmagolan commented Apr 14, 2024

Copy link
Copy Markdown
Member

No description provided.

@gregmagolan gregmagolan force-pushed the rjs2_target_bin_dir_js_info branch from 35f5de8 to 2033e65 Compare April 14, 2024 06:12
Comment thread js/private/js_helpers.bzl
Comment thread js/private/js_info.bzl Outdated
@jbedard

jbedard commented Apr 14, 2024

Copy link
Copy Markdown
Member

Why are these being added? What will they be used for?

@gregmagolan

Copy link
Copy Markdown
Member Author

Why are these being added? What will they be used for?

Read the summary

@jbedard

jbedard commented Apr 14, 2024

Copy link
Copy Markdown
Member

I know it's for #1646 and have looked at the code there as well, I was still hoping for more of an understanding of it though. There's no point merging this without understanding it first 🤷

@gregmagolan gregmagolan requested a review from jbedard April 14, 2024 16:54
@gregmagolan

gregmagolan commented Apr 14, 2024

Copy link
Copy Markdown
Member Author

I know it's for #1646 and have looked at the code there as well, I was still hoping for more of an understanding of it though. There's no point merging this without understanding it first 🤷

The code in #1646 is fairly easy to follow to find the use case. TL;DR is that in #1646 we're linking to a directory in the output tree so there is no File to get the path to that from. Instead we use a combination of the JsInfo bin_dir.path and the target.package to determine the directory path in the output tree to symlink to.

@jbedard

jbedard commented Apr 14, 2024

Copy link
Copy Markdown
Member

I would vote to only add these fields once we need them and they are actually used, so in the main PR. Want to change this PR just to do the re-ordering and fail cleanup?

@gregmagolan gregmagolan force-pushed the rjs2_target_bin_dir_js_info branch from 2033e65 to f166afa Compare April 15, 2024 14:54
@gregmagolan gregmagolan changed the title refactor: add mandatory target & bin_dir fields to JsInfo provider refactor: re-order fields in JsInfo for readability Apr 15, 2024
@gregmagolan

Copy link
Copy Markdown
Member Author

I would vote to only add these fields once we need them and they are actually used, so in the main PR. Want to change this PR just to do the re-ordering and fail cleanup?

Sure. Updated.

@gregmagolan gregmagolan merged commit d512ac9 into 2.x Apr 15, 2024
@gregmagolan gregmagolan deleted the rjs2_target_bin_dir_js_info branch April 15, 2024 16:15
@gregmagolan gregmagolan mentioned this pull request Apr 29, 2024
21 tasks
jbedard pushed a commit to jbedard/rules_js that referenced this pull request May 14, 2024
jbedard pushed a commit to jbedard/rules_js that referenced this pull request May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants