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

Expose normalizePath helper #440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Expose normalizePath helper #440

wants to merge 1 commit into from

Conversation

marvinhagemeister
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2021

⚠️ No Changeset found

Latest commit: 1e6d5ff

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2021

Size Change: -43 B (0%)

Total Size: 740 kB

Filename Size Change
packages/wmr/wmr.cjs 703 kB -43 B (0%)
ℹ️ View Unchanged
Filename Size Change
examples/demo/dist/about/index.html 697 B 0 B
examples/demo/dist/assets/Calendar.********.css 702 B 0 B
examples/demo/dist/assets/style.********.css 624 B 0 B
examples/demo/dist/chunks/class-fields.********.js 208 B 0 B
examples/demo/dist/chunks/compat.********.js 15.3 kB 0 B
examples/demo/dist/chunks/index.********.js 261 B 0 B
examples/demo/dist/chunks/json.********.js 236 B 0 B
examples/demo/dist/chunks/meta-tags.********.js 278 B 0 B
examples/demo/dist/chunks/prerender.********.js 2.43 kB 0 B
examples/demo/dist/class-fields/index.html 687 B 0 B
examples/demo/dist/compat/index.html 1.58 kB 0 B
examples/demo/dist/env/index.html 757 B 0 B
examples/demo/dist/error/index.html 690 B 0 B
examples/demo/dist/files/index.html 720 B 0 B
examples/demo/dist/index.********.js 8.9 kB 0 B
examples/demo/dist/index.html 752 B 0 B
examples/demo/dist/json/index.html 697 B 0 B
examples/demo/dist/lazy-and-late/index.html 698 B 0 B
examples/demo/dist/meta-tags/index.html 761 B 0 B

compressed-size-action

@marvinhagemeister
Copy link
Member Author

@developit @JoviDeCroock @rschristian I'm unsure about the name normalizePath despite that being the name of the function in both vite and rollup. To me it's not immediately obvious what normalize means in this context. With the word "normalization" in regards to paths, I think of dropping dots in paths like foo/../../ or stuff. Basically what node's path.normalize does.

But both we and rollup don't do anything that fancy here. We just convert the path to posix style slashes. There is an argument to be made for future proofing the name with normalizePath because it can contain additional normalization stuff in the future, but I'm not sure.

What do you folks think?

@rschristian
Copy link
Member

I agree. I think normalize is entirely context-driven and it's not immediately obvious what kind of normalization the context here requires. There's a lot of ways paths can be "normalized".

I'd be in favour of a much tighter name, even if that means losing out on a bit of future proofing. Even good docs can't fix a vague function name.

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.

3 participants