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(remix-dev): deprecate serverBuildTarget #4841

Merged
merged 4 commits into from
Feb 2, 2023

Conversation

MichaelDeBoey
Copy link
Member

As discussed in the second roadmap livestream


Closes #3556

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2022

⚠️ No Changeset found

Latest commit: bdc6ff1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jenseng
Copy link
Contributor

jenseng commented Dec 12, 2022

Between this and #4842 are we missing anything? I see there are some places where we key off of this in the compiler (e.g. here), do we need additional config to support this behavior?

@MichaelDeBoey
Copy link
Member Author

@jenseng Good call!
That's indeed something we need to figure out in some other way 🤔

Listing all the usages:

@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch from 60d523b to ce1da85 Compare December 13, 2022 00:02
@MichaelDeBoey
Copy link
Member Author

@harmony7 mentioned the same problem in #4860 regarding not being able to fully deprecate serverBuildtarget

This PR is necessary because, except for the first two subitems in the list above, these behaviors cannot be set through remix.config.js.

@harmony7
Copy link
Contributor

Looks like this is going to be solving #4615 that was one of my concerns, too. Thanks.

@mcansh
Copy link
Collaborator

mcansh commented Dec 14, 2022

bundling everything should be achievable using serverDependenciesToBundle: /.*/, but still need a way to set conditions, minify, and mainfield for esbuild

@MichaelDeBoey
Copy link
Member Author

MichaelDeBoey commented Dec 14, 2022

@mcansh So how do you think that would that look like?
Creating new serverConditions, serverMinify & serverMainFields config options?

If so, I would suggest to go with a server object instead, to not pollute the global config namespace.

CC/ @mjackson @ryanflorence

@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch from ce1da85 to b9659ba Compare December 21, 2022 18:41
@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch from b9659ba to efca105 Compare January 18, 2023 16:11
@mjackson
Copy link
Member

new serverConditions, serverMinify & serverMainFields config options

Yeah, @MichaelDeBoey. I think we will need these.

If so, I would suggest to go with a server object instead, to not pollute the global config namespace.

No, let's keep the config object as flat as possible.

@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch 7 times, most recently from 1503453 to cd275d2 Compare January 22, 2023 01:47
@MichaelDeBoey
Copy link
Member Author

MichaelDeBoey commented Jan 22, 2023

@mjackson I introduced the serverConditions, serverMinify & serverMainFields config options and updated serverDependenciesToBundle so that it can also receive "all" as value.

The only places where we're now still using serverBuildTarget is in serverBareModulesPlugin:

Can't think of a good way to remove usage here though 🤔

CC/ @jacob-ebey @mcansh @pcattori as you have been working in this file on the parts that still need a solution.

@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch 4 times, most recently from 7a92623 to 54ed18e Compare January 22, 2023 18:18
@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch 2 times, most recently from cdffd2e to fa12cfd Compare January 25, 2023 12:55
packages/remix-dev/__tests__/readConfig-test.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
packages/remix-dev/config.ts Outdated Show resolved Hide resolved
@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch 2 times, most recently from aa69803 to ed8ea5f Compare February 2, 2023 17:34
@MichaelDeBoey MichaelDeBoey force-pushed the deprecate-serverBuildTarget branch from 5b89789 to 5a1fe1d Compare February 2, 2023 18:08
@jacob-ebey jacob-ebey merged commit aeaf216 into remix-run:dev Feb 2, 2023
@MichaelDeBoey MichaelDeBoey deleted the deprecate-serverBuildTarget branch February 2, 2023 21:11
@harmony7
Copy link
Contributor

harmony7 commented Feb 3, 2023

awesome stuff! =)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-79859c9-20230203 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@TrySound
Copy link
Contributor

TrySound commented Apr 5, 2023

Client conditions would be useful too
#6003

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.

7 participants