Skip to content

Commit e65802a

Browse files
authored
DOCSP-45307: Drop external polyfill library support (#74)
* DOCSP-45307: Drop external polyfill library support * JS feedback * JS feedback 2 * tech review * polyfills * fixes * EC feedback 2 * wording * EC last feedback
1 parent 0a45499 commit e65802a

File tree

6 files changed

+94
-81
lines changed

6 files changed

+94
-81
lines changed

source/api-abi-versioning.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ Examples of expected library filenames (with a brief description of notable feat
193193
- ``bsoncxx-v_noabi-dhs-x64-v142-mdd.dll`` (debug build configuration)
194194
- ``bsoncxx-v_noabi-rts-x64-v142-md.dll`` (link with mongoc static libraries)
195195
- ``bsoncxx-v_noabi-rhi-x64-v142-md.dll`` (bsoncxx as polyfill library)
196-
- ``bsoncxx-v_noabi-rhm-x64-v142-md.dll`` (mnmlstc/core as polyfill library)
197-
- ``bsoncxx-v_noabi-rhb-x64-v142-md.dll`` (Boost as polyfill library)
198196
- ``bsoncxx-v1-rhs-x64-v142-md.dll`` (ABI version number 1)
199197
- ``bsoncxx-v2-rhs-x64-v142-md.dll`` (ABI version number 2)
200198

source/get-started/download-and-install.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@ Download and Install
1616

1717
.. step:: Install dependencies
1818

19-
Before you being developing, ensure you have the following dependencies
19+
Before you being this tutorial, ensure you have the following dependencies
2020
installed in your development environment:
2121

2222
- Compiler that supports C++17, such as `GCC <https://gcc.gnu.org/install/>`__, `Clang <https://clang.llvm.org/>`__,
2323
or `Visual Studio <https://visualstudio.microsoft.com/>`__
2424
- `CMake <https://cmake.org/>`__ v3.15 or later
2525
- `pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config/>`__
2626

27-
.. note:: C++17 Polyfills
27+
.. note:: Pre-C++17 Configurations
2828

29-
This tutorial configures the {+driver-short+} to use the C++17 standard
30-
library. If you want to install the driver for pre-C++17 configurations,
31-
you must choose a C++17 polyfill library. To learn more about C++17
32-
polyfills, see the :ref:`cpp-polyfill-selection` guide.
29+
Although C++11 is the minimum supported language version, this tutorial
30+
configures the {+driver-short+} to use the C++17 standard library
31+
as recommended by the :ref:`cpp-polyfill-config` section. If you want to install
32+
the driver for pre-C++17 configurations, set the ``CMAKE_CXX_STANDARD``
33+
configuration option to your C++ version. Then, the driver will automatically use
34+
bsoncxx library polyfill implementations for required C++17 features.
3335

3436
.. step:: Download the {+driver-short+}
3537

@@ -56,6 +58,7 @@ Download and Install
5658

5759
cmake .. \
5860
-DCMAKE_BUILD_TYPE=Release \
61+
-DCMAKE_CXX_STANDARD=17 \
5962
-DMONGOCXX_OVERRIDE_DEFAULT_INSTALL_PREFIX=OFF
6063

6164
This command instructs CMake to install ``mongocxx`` into the ``/usr/local`` directory.

source/index.txt

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ MongoDB C++ Driver
1919
Run a Command </run-command>
2020
Security </security>
2121
Specialized Data Formats </data-formats>
22-
C++17 Polyfill </polyfill-selection>
2322
Advanced Configuration & Installation </advanced-installation>
2423
Thread & Fork Safety </thread-safety>
2524
API & ABI Versioning </api-abi-versioning>
@@ -83,12 +82,6 @@ Specialized Data Formats
8382
Learn how to work with specialized data formats and custom types in the
8483
:ref:`cpp-data-formats` section.
8584

86-
Choose a C++17 Polyfill
87-
-----------------------
88-
89-
Learn how to a choose a polyfill library implementation for
90-
pre-C++ 17 configurations in the :ref:`cpp-polyfill-selection` section.
91-
9285
Advanced Installation Options
9386
-----------------------------
9487

@@ -126,6 +119,29 @@ API Documentation
126119
For detailed information about types and methods in the {+driver-short+}, see
127120
the `{+driver-short+} API documentation <{+api+}>`__.
128121

122+
.. _cpp-polyfill-config:
123+
124+
C++17 Polyfill Configuration
125+
----------------------------
126+
127+
.. important::
128+
129+
We recommend using the C++ standard library whenever possible by setting the
130+
``CMAKE_CXX_STANDARD`` configuration option to ``17`` or newer.
131+
132+
The {+driver-long+} uses C++17 features ``std::optional<T>`` and ``std::string_view``.
133+
If you configure the driver with a pre-C++17 standard, the bsoncxx library provides
134+
polyfill implementations for these C++17 features. The driver uses the bsoncxx polyfill
135+
implementations when the ``CMAKE_CXX_STANDARD`` configuration option is set to a number
136+
less than ``17``. By default, this option is set to ``11``.
137+
138+
.. warning::
139+
140+
The choice of polyfill library has a direct impact on the public API and ABI for the mongocxx
141+
library. Changing the polyfill can lead to both source-breaking changes during compilation
142+
and binary-breaking changes during linking or execution. To limit reliance on polyfill-specific
143+
behavior, avoid using ``stdx::string_view`` and ``stdx::optional<T>`` with non-bsoncxx and non-mongocxx
144+
library interfaces.
129145

130146
Driver Status by Family and Version
131147
-----------------------------------

source/polyfill-selection.txt

Lines changed: 0 additions & 63 deletions
This file was deleted.

source/upgrade.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,28 @@ and upgrade versions.
6666
If you're upgrading the {+driver-short+} from version 3.0 to version 3.10,
6767
address all breaking changes listed for versions 3.1 to 3.10, if any.
6868

69+
.. _version-4.0-breaking-changes:
70+
71+
Version 4.0 Breaking Changes
72+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73+
74+
This driver version introduces the following breaking changes:
75+
76+
- Drops support for the Boost and MNMLSTC/core external polyfill libraries. You can no
77+
longer set the following configuration options:
78+
79+
- ``ENABLE_BSONCXX_POLY_USE_IMPLS``. This option is implicitly set to ``ON``.
80+
- ``BSONCXX_POLY_USE_MNMLSTC``.
81+
- ``BSONCXX_POLY_USE_SYSTEM_MNMLSTC``.
82+
- ``BSONCXX_POLY_USE_BOOST``.
83+
6984
.. _version-3.11-breaking-changes:
7085

7186
Version 3.11 Breaking Changes
7287
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7388

89+
This driver version introduces the following breaking changes:
90+
7491
- Drops support for {+mdb-server+} v3.6.
7592
- Requires MongoDB C Driver v1.28.0 or later.
7693
- Removes export of the following private member functions in the bsoncxx

source/whats-new.txt

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Overview
2222

2323
Learn what's new in:
2424

25+
* :ref:`Version 4.0 <version-4.0>`
2526
* :ref:`Version 3.11 <version-3.11>`
2627
* :ref:`Version 3.10 <version-3.10>`
2728
* :ref:`Version 3.9 <version-3.9>`
@@ -73,18 +74,59 @@ New versions of the {+driver-short+} can introduce the following types of breaki
7374
- Drops support for platform A, compiler B, or architecture C.
7475

7576
.. _upcoming-breaking-changes:
77+
.. _version-4.0:
78+
79+
What's New in 4.0
80+
-----------------
81+
82+
.. _version-4.0-build-system-breaking:
83+
84+
.. warning:: Build System Breaking Changes
85+
86+
The v4.0 driver introduces the following breaking changes to the build system:
87+
88+
- Drops support for the Boost and MNMLSTC/core external polyfill libraries. You can no
89+
longer set the following configuration options:
90+
91+
- ``ENABLE_BSONCXX_POLY_USE_IMPLS``. This option is implicitly set to ``ON``.
92+
- ``BSONCXX_POLY_USE_MNMLSTC``.
93+
- ``BSONCXX_POLY_USE_SYSTEM_MNMLSTC``.
94+
- ``BSONCXX_POLY_USE_BOOST``.
95+
96+
.. warning:: API Breaking Changes
97+
98+
The v4.0 driver introduces the following breaking changes to the API:
99+
100+
- Drops support for configuring ``bsoncxx::stdx::string_view`` and
101+
``bsoncxx::stdx::optional<T>`` as aliases for Boost or MNMLSTC/core
102+
library equivalents. For context, see the :ref:`Build System Breaking Changes
103+
<version-4.0-build-system-breaking>` admonition.
104+
105+
.. warning:: ABI Breaking Changes
106+
107+
The v4.0 driver introduces the following breaking changes to the ABI:
108+
109+
- Drops support for configuring ``bsoncxx::stdx::string_view`` and
110+
``bsoncxx::stdx::optional<T>`` as aliases for Boost or MNMLSTC/core
111+
library equivalents. For context, see the :ref:`Build System Breaking Changes
112+
<version-4.0-build-system-breaking>` admonition.
76113

77114
.. _version-3.11:
78115

79116
What's New in 3.11
80117
------------------
81118

82-
.. warning:: Breaking Changes
119+
.. warning:: Build System Breaking Changes
120+
121+
The v3.11 driver introduces the following breaking changes to the build system:
83122

84-
The v3.11 driver introduces the following breaking changes:
85-
86123
- Drops support for {+mdb-server+} v3.6.
87124
- Requires MongoDB C Driver v1.28.0 or later.
125+
126+
.. warning:: ABI Breaking Changes
127+
128+
The v3.11 driver introduces the following breaking changes to the ABI:
129+
88130
- Removes export of the following private member functions in the bsoncxx
89131
ABI:
90132

0 commit comments

Comments
 (0)