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

temporary-fix(big bundle & cannot-resolve-symbol): revert to non-optimized bundling until it's fixed in qwik #521

Closed
wants to merge 3 commits into from

Conversation

maiieul
Copy link
Contributor

@maiieul maiieul commented Nov 20, 2023

TLDR: I think it would be best to keep the unoptimized bundle until a real fix can be made in the optimizer or until we're ready for v1 if the optimizer issue hasn't been fixed by then.

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

Description

I removed

      output: {
        preserveModules: true,
        preserveModulesRoot: 'packages/kit-headless/src',
      },

from the headless-kit's vite config, because it creates the namespace issues described in #519, for which there is no great workaround in terms of DX.

This brings back the big bundle issue, but the "big bundle" isn't so big on first load anyway, and subsequent requests will be loaded from the browser cache.

To make the bundle smaller, I removed country-list-json and libphonenumber-js dependencies and all related code (which didn't receive any attention for the past 6 months). We can always add it back later or create another package for those kinds of components if the bug hasn't been fixed by then.

Performance should be okay now (11kb on first load 👇)

image

⚠️ I reused some of the code from #511, updated to latest qwik version, and made sure that everything works in dev and preview (the workspace dependency was causing issues to the build step). I suggest to first merge this PR and then @shairez you can work on top of it for the utils package.

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

@maiieul
Copy link
Contributor Author

maiieul commented Nov 22, 2023

In case anyone's looking into this, I had a programming session with Shai and we think we know what's causing the namespace issues when using preserveModules, so we're holding off for now.

@shairez
Copy link
Contributor

shairez commented Dec 13, 2023

closing this in favor of the recent fixes

@shairez shairez closed this Dec 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants