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

feat: enhance type capabilities #2185

Merged
merged 63 commits into from
Apr 2, 2024
Merged

feat: enhance type capabilities #2185

merged 63 commits into from
Apr 2, 2024

Conversation

2heal1
Copy link
Member

@2heal1 2heal1 commented Mar 12, 2024

Description

  • support types hot reload
  • support re-export remote types
  • support consume/generate runtime api types
  • support extract third parth types

demo start steps:

  1. install deps
pnpm i 
  1. build needed packages
nx build
  1. start demos
pnpm app:ts:dev

You will see react-ts-host will auto fetch its remote types

And react_ts_nested_remote's dep react_ts_remote will be stored in react_ts_nested_remote's/node_modules which can support re-export remote .

image

when update the react_ts_nested_remote , the host will auto fetch the latest types :
hot-types-reload

Related Issue

#2154

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@zackarychapple
Copy link
Collaborator

Would be helpful to know roughly what the dev server is doing.

@2heal1
Copy link
Member Author

2heal1 commented Mar 21, 2024

Would be helpful to know roughly what the dev server is doing.

I forget to add the rfc link , here is : #2154

And more details will be added soon

@zhoushaw zhoushaw self-requested a review April 1, 2024 09:27
@ilteoood
Copy link
Collaborator

ilteoood commented Apr 1, 2024

But for rspack/webpack , the reason why i specially process it is because i need to emit the dist(@mf-types.zip) to bundler assets , which can work on most bundler assets analyzer plugin.

Can you argue a bit about this? Sorry I didn't get what you mean

The plugin should emit the extra asset(@mf-types.zip) to the compiler self filesystem, because most plugin will use compilation.getAssets() to process the assets , such as webpack-manifest-plugin.

Got it. But to do so, IMO you don't need any of this code. As I said, using the bundler's proxy and a simple server would be enough and also bundler agnostic

@2heal1
Copy link
Member Author

2heal1 commented Apr 1, 2024

This is not for visit the type archive , is aims to help build analyzer get correct assets in prod environment

@2heal1 2heal1 requested a review from ilteoood April 2, 2024 08:17
@zhoushaw zhoushaw removed the request for review from ilteoood April 2, 2024 08:18
@2heal1 2heal1 merged commit c8c0ad2 into main Apr 2, 2024
7 checks passed
@2heal1 2heal1 deleted the feat/dev-server branch April 2, 2024 08:19
@zhoushaw zhoushaw mentioned this pull request Apr 3, 2024
@ilteoood
Copy link
Collaborator

ilteoood commented Apr 3, 2024

@zhoushaw I think that removing the plugin owner from the review is an highly unprofessional behaviour.
How can you approve a PR that:

Lots of comments I made have been ignored, but in the end this has been merged anyway, bringing into the plugin lots of crappy code full of eslint-ignore comments.

I don't know if this is your usual way of work, but please stop ruining the work of people who try to keep high standards.

@zhoushaw
Copy link
Collaborator

zhoushaw commented Apr 4, 2024

@ilteoood I apologize for changing the reviewer's behavior, because Zhang Hang told me that the relevant problem has been fixed, and I saw that the relevant comments have been resolved,It seems that lint rules do not restrict some syntax content, is it possible to adjust lint to automatically handle some non-standard code?

@zhoushaw
Copy link
Collaborator

zhoushaw commented Apr 4, 2024

@2heal1 It seems that some of our errors have not been fixed, and I think we should fix this part of the optimization as soon as possible

@zhoushaw
Copy link
Collaborator

zhoushaw commented Apr 4, 2024

@ilteoood For code style, I think we can add lint to handle

@ScriptedAlchemy
Copy link
Member

ScriptedAlchemy commented Apr 4, 2024

@ilteoood apologies for this. We will work to rectify this and appreciate your effort, input, and feedback.

I can understand your frustration, but lets maintain a friendly correspondence in feedback.
I believe some things slipped through the cracks here and ultimately lead to a frustrations.

In the future we will be more careful regarding input and overwrites to other authored works.

growing pains

@zhoushaw
Copy link
Collaborator

zhoushaw commented Apr 4, 2024

https://github.com/module-federation/universe/blob/main/CODE_OF_CONDUCT.md

We will maintain the above code of conduct, If there are problems and feedback, we will accept the feedback with sincerity and patience and improve it, but we refuse to communicate in an unfriendly way

@zhoushaw
Copy link
Collaborator

zhoushaw commented Apr 4, 2024

I will give some feedback on the points mentioned in this pr:

The code style issues with the comments should all have been fixed,This part is best constrained and automated through prettierrc and lint rule sets

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.

5 participants