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

refactor(macro): split js (core) and jsx (react) macro #1461

Closed
wants to merge 1 commit into from

Conversation

thekip
Copy link
Collaborator

@thekip thekip commented Feb 23, 2023

#1361

@Martin005 @andrii-bodnar please take a look here. I want to get feedback before i continue.

Overview:

graph LR
    core("@lingui/core/macro") --> lib("@lingui/macro-lib")
    react("@lingui/react/macro") --> lib
    macro("@lingui/macro") --> react
    macro --> core

Loading

@vercel
Copy link

vercel bot commented Feb 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 1, 2023 at 0:08AM (UTC)

@github-actions
Copy link

github-actions bot commented Feb 23, 2023

size-limit report 📦

Path Size
./packages/core/build/esm/index.js 1.72 KB (0%)
./packages/detect-locale/build/esm/index.js 812 B (0%)
./packages/react/build/esm/index.js 1.79 KB (0%)
./packages/remote-loader/build/esm/index.js 7.25 KB (0%)

@thekip thekip changed the title ref(macro): split js (core) and jsx (react) macro refactor(macro): split js (core) and jsx (react) macro Feb 23, 2023
@andrii-bodnar
Copy link
Contributor

Looks interesting, but I don't really like the nascence of the new package, can we avoid it? Previously we discussed it and agreed that it was possible

@thekip
Copy link
Collaborator Author

thekip commented Feb 23, 2023

Looks interesting, but I don't really like the nascence of the new package, can we avoid it? Previously we discussed it and agreed that it was possible

No. Look at the graph i wrote in the description.

Why you so don't like introducing new packages? It's the way how it works. It's internal and nobody should care.
Look at the formatjs or jest packages.

@andrii-bodnar
Copy link
Contributor

Sure, I saw the graph. I can't say that I don't like new packages, but I prefer not to introduce new "entities" if possible and there is no urgent need

If it's inevitable, it'll be so 🤷‍♂️

@andrii-bodnar
Copy link
Contributor

andrii-bodnar commented Feb 24, 2023

The most I worrying here about - is the potential @lingui/core bundle size increase

@thekip
Copy link
Collaborator Author

thekip commented Feb 24, 2023

There would be no bundle size increase (the macro is not bundled), but installation size of @lingui/coreand @lingui/react would increase. For users who use macro nothing will be changed, installation size of all packages would be the same. For users who not using macro - yes, now macro and babel are always installed. But frankly speaking, i would not worry too much about non-macro usage, the main use case is with macro and we should concentrate our effort to make it highly polished.

@thekip
Copy link
Collaborator Author

thekip commented Mar 10, 2023

i don't know why, but i don't like what happened here 😬

We indeed need to split macro for different frameworks, but the idea that all babel dependencies would be installed even if you are not using them makes me nervous.

Also i don't understand how we should organize tests in the repo. Now they live in one place, and we have cases where jsx + and js macro tested together. How this should be done after split i don't know.

@andrii-bodnar
Copy link
Contributor

Let's postpone it to the future major release (v5 or v6), maybe later we will have a better understanding of how to properly do this

@andrii-bodnar
Copy link
Contributor

Will close this PR for now

@thekip thekip deleted the refactor/split-macro branch March 19, 2024 09:39
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.

RFC: Split macro to vanilla js + react
2 participants