Skip to content

Remove the concept of the 'current module' in Docs - #3506

Merged
hdgarrood merged 1 commit into
masterfrom
refactor-docs-remove-current-module
Jan 7, 2019
Merged

Remove the concept of the 'current module' in Docs#3506
hdgarrood merged 1 commit into
masterfrom
refactor-docs-remove-current-module

Conversation

@hdgarrood

Copy link
Copy Markdown
Contributor

The concept of the current module is unnecessary (we aren't using it
anywhere either in the compiler or in Pursuit) as well as potentially
confusing; for example, what is the 'current module' when we are
rendering re-exported declarations? Additionally, since the information
is not used, it would be easy for it to become incorrect without anyone
noticing.

This commit refactors the Docs related code, removing the concept of the
current module. Specifically, the following have been removed:

  • the SameModule constructor from the LinkLocation data type;
    wherever we previously would have used that, we can now use the
    LocalModule constructor, which encodes precisely the same information.
  • the 'current module' field from the constructors LocalModule and
    DepsModule of the data type LinkLocation, which was unused.
  • the 'currentModuleName' field of the HtmlRenderContext data type,
    which was also unused.

I came across this refactoring opportunity while looking into #3504.

The concept of the current module is unnecessary (we aren't using it
anywhere either in the compiler or in Pursuit) as well as potentially
confusing; for example, what is the 'current module' when we are
rendering re-exported declarations? Additionally, since the information
is not used, it would be easy for it to become incorrect without anyone
noticing.

This commit refactors the Docs related code, removing the concept of the
current module. Specifically, the following have been removed:

- the SameModule constructor from the LinkLocation data type;
  wherever we previously would have used that, we can now use the
  LocalModule constructor, which encodes precisely the same information.
- the 'current module' field from the constructors LocalModule and
  DepsModule of the data type LinkLocation, which was unused.
- the 'currentModuleName' field of the HtmlRenderContext data type,
  which was also unused.

I came across this refactoring opportunity while looking into #3504.
@hdgarrood

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

@hdgarrood
hdgarrood merged commit 913b46f into master Jan 7, 2019
@hdgarrood
hdgarrood deleted the refactor-docs-remove-current-module branch January 7, 2019 14:07
@garyb garyb mentioned this pull request Jan 12, 2019
3 tasks
dariooddenino pushed a commit to dariooddenino/purescript that referenced this pull request Jan 18, 2019
The concept of the current module is unnecessary (we aren't using it
anywhere either in the compiler or in Pursuit) as well as potentially
confusing; for example, what is the 'current module' when we are
rendering re-exported declarations? Additionally, since the information
is not used, it would be easy for it to become incorrect without anyone
noticing.

This commit refactors the Docs related code, removing the concept of the
current module. Specifically, the following have been removed:

- the SameModule constructor from the LinkLocation data type;
  wherever we previously would have used that, we can now use the
  LocalModule constructor, which encodes precisely the same information.
- the 'current module' field from the constructors LocalModule and
  DepsModule of the data type LinkLocation, which was unused.
- the 'currentModuleName' field of the HtmlRenderContext data type,
  which was also unused.

I came across this refactoring opportunity while looking into purescript#3504.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants